business\Time::toInteger PHP Method

toInteger() public method

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

Usage Example

示例#1
0
 public function testToInteger()
 {
     $time = new Time('20', '00');
     $this->assertEquals(200000, $time->toInteger());
     $time = new Time('09', '30');
     $this->assertEquals(93000, $time->toInteger());
 }