dateUTCToLocal.php
Table of Contents
Functions
- dateUTCToLocal() : string
- Converts a UTC (Zulu time) date or timestamp into a local timezone date.
Functions
dateUTCToLocal()
Converts a UTC (Zulu time) date or timestamp into a local timezone date.
dateUTCToLocal([string|int|null $date = null ][, string $timezone = "Europe/Paris" ][, bool $throwable = false ]) : string
Constructs an AQL expression in the form:
DATE_UTCTOLOCAL(date, timezone, zoneinfo)
Converts a UTC timestamp or ISO 8601 string into the specified local time zone.
If no date is provided, the current time (DATE_NOW()) is used.
By default, throws an InvalidArgumentException if the $timezone is not a valid IANA timezone.
Parameters
- $date : string|int|null = null
-
A numeric timestamp or ISO 8601 date-time string. Defaults to
DATE_NOW()if null. - $timezone : string = "Europe/Paris"
-
IANA timezone name (e.g.,
"America/New_York","Europe/Berlin","UTC"). Use"America/Los_Angeles"for Pacific Time (PST/PDT). - $throwable : bool = false
-
Whether to throw an exception on invalid timezone (default: true).
Tags
Return values
string —The AQL expression returning the date converted from UTC to the specified local time zone.