lib/Utils/DateTimeUtils.php
public static function createFromTimestamp(?int $timestamp = null, ?string $timeZone = null): DateTimeInterface
    {
        $dateTimeZone = is_string($timeZone) ? new DateTimeZone($timeZone) : null;
        $timestamp = is_int($timestamp) ? $timestamp : time();

        $dateTime = new DateTimeImmutable('now', $dateTimeZone);

        return $dateTime->setTimestamp($timestamp);
    }
public static function createFromTimestamp(?int $timestamp = null, ?string $timeZone = null): DateTimeInterface
    {
        $dateTimeZone = is_string($timeZone) ? new DateTimeZone($timeZone) : null;
        $timestamp = is_int($timestamp) ? $timestamp : time();

        $dateTime = new DateTimeImmutable('now', $dateTimeZone);

        return $dateTime->setTimestamp($timestamp);
    }
public static function createFromTimestamp ( ? int $ timestamp = null , ? string $ timeZone = null ) : DateTimeInterface { $ dateTimeZone = is_string ( $ timeZone ) ? new DateTimeZone ( $ timeZone ) : null ; $ timestamp = is_int ( $ timestamp ) ? $ timestamp : time ( ) ; $ dateTime = new DateTimeImmutable ( 'now' , $ dateTimeZone ) ; return $ dateTime -> setTimestamp ( $ timestamp ) ; }
Creates a new \DateTimeImmutable instance from provided timestamp and timezone identifiers.

Current timestamp and timezones are used if not provided.
Creates a new \ DateTimeImmutable instance from provided timestamp and timezone identifiers .