29 if (!in_array($timezone, timezone_identifiers_list())) {
30 throw new \InvalidArgumentException(
"$timezone is not a valid timezone identifier", 1);
32 $this->timezone = new \DateTimeZone($timezone);
41 throw new \InvalidArgumentException(
"$from is not a DateTimeImmutable-object", 1);
44 $ts = $from->format(
'Y-m-d H:i:s');
45 $to = new \DateTimeImmutable($ts, $this->timezone);
__invoke($from)
Transformations should be callable.This MUST do the same as transform.
__construct(string $timezone)
trait DeriveApplyToFromTransform
transform($from)
Perform the transformation.Please use this for transformations. It's more performant than calling inv...
Change the timezone (and only the timezone) of php's WITHOUT changing the date-value.