src/ValueObject/TimeOffset.php
public static function buildFromDateTimeInterface(DateTimeInterface $date)
    {
        $parts = explode('|', $date->format('Z|I|T'));

        return new static((int)$parts[0], (bool)$parts[1], $parts[2]);
    }
public static function buildFromDateTimeInterface(DateTimeInterface $date)
    {
        $parts = explode('|', $date->format('Z|I|T'));

        return new static((int)$parts[0], (bool)$parts[1], $parts[2]);
    }
public static function buildFromDateTimeInterface ( DateTimeInterface $ date ) { $ parts = explode ( '|' , $ date -> format ( 'Z|I|T' ) ) ; return new static ( ( int ) $ parts [ 0 ] , ( bool ) $ parts [ 1 ] , $ parts [ 2 ] ) ; }
Instanciates a TimeOffset from a DateTimeInterface, using the format
method to extract properties.

@param DateTimeInterface $date

@return static
Instanciates a TimeOffset from a DateTimeInterface using the format method to extract properties .