31 if (!in_array($timezone, timezone_identifiers_list())) {
32 throw new \InvalidArgumentException(
"$timezone is not a valid timezone identifier", 1);
34 $this->timezone = new \DateTimeZone($timezone);
43 throw new \InvalidArgumentException(
"$from is not a DateTimeImmutable-object", 1);
46 $ts = $from->format(
'Y-m-d H:i:s');
47 $to = new \DateTimeImmutable($ts, $this->timezone);
__construct(string $timezone)
trait DeriveApplyToFromTransform
transform($from)
Perform the transformation.Please use this for transformations. It's more performant than calling inv...
trait DeriveInvokeFromTransform
Change the timezone (and only the timezone) of php's WITHOUT changing the date-value.