public static function fromDate(\DateTime $date): Time
    {
        return new Time((int)$date->format('H'), (int)$date->format('i'), (int)$date->format('s'));
    }
public static function fromDate(\DateTime $date): Time
    {
        return new Time((int)$date->format('H'), (int)$date->format('i'), (int)$date->format('s'));
    }
public static function fromDate ( \ DateTime $ date ) : Time { return new Time ( ( int ) $ date -> format ( 'H' ) , ( int ) $ date -> format ( 'i' ) , ( int ) $ date -> format ( 's' ) ) ; }
Create a new time from a date.

@param \DateTime $date The date.
@return Time
Create a new time from a date .