protected function toDateTime(string $representation): DateTimeImmutable
    {
        // Due to a Tikkie bug, the API may return epoch timestamps with milliseconds instead of a ISO-8601 formatted string.
        // I reported this on 24-04-2019.
        if (is_numeric($representation)) {
            // Remove milliseconds and prepend with @ to mark as timestamp.
            $representation = '@'.substr($representation, 0, 10);
        }

        return new DateTimeImmutable($representation);
    }
protected function toDateTime(string $representation): DateTimeImmutable
    {
        // Due to a Tikkie bug, the API may return epoch timestamps with milliseconds instead of a ISO-8601 formatted string.
        // I reported this on 24-04-2019.
        if (is_numeric($representation)) {
            // Remove milliseconds and prepend with @ to mark as timestamp.
            $representation = '@'.substr($representation, 0, 10);
        }

        return new DateTimeImmutable($representation);
    }
protected function toDateTime ( string $ representation ) : DateTimeImmutable { // Due to a Tikkie bug, the API may return epoch timestamps with milliseconds instead of a ISO-8601 formatted string. // I reported this on 24-04-2019. if ( is_numeric ( $ representation ) ) { // Remove milliseconds and prepend with @ to mark as timestamp. $ representation = '@' . substr ( $ representation , 0 , 10 ) ; } return new DateTimeImmutable ( $ representation ) ; }
Convert an ISO-8601 formatted string to DateTimeImmutable.
Convert an ISO - 8601 formatted string to DateTimeImmutable .