business\Time::toString PHP Method

toString() public method

Returns an integer representation of the time.
public toString ( ) : integer
return integer
    public function toString()
    {
        return sprintf('%02d:%02d:%02d', $this->hours, $this->minutes, $this->seconds);
    }

Usage Example

示例#1
0
 public function testToString()
 {
     $time = new Time('20', '30');
     $this->assertEquals('20:30:00', $time->toString());
     $time = new Time('9', '8', '7');
     $this->assertEquals('09:08:07', $time->toString());
     $time = new Time(9, 8, 7);
     $this->assertEquals('09:08:07', $time->toString());
 }
All Usage Examples Of business\Time::toString