dateLocalToUTC.php
Table of Contents
Functions
- dateLocalToUTC() : string
- Converts a local date/time from a specified timezone to UTC.
Functions
dateLocalToUTC()
Converts a local date/time from a specified timezone to UTC.
dateLocalToUTC([int|string|null $date = null ][, string $timezone = "UTC" ][, bool $throwable = true ]) : string
Constructs an AQL expression in the format:
DATE_LOCALTOUTC(date, timezone)
where date can be a numeric timestamp or ISO 8601 string, and timezone is a valid IANA timezone name.
If $date is null, the current date/time (DATE_NOW()) is used.
By default, throws an InvalidArgumentException if the $timezone is not a valid IANA timezone.
Parameters
- $date : int|string|null = null
-
Numeric timestamp or ISO 8601 date string. Defaults to
DATE_NOW()if null. - $timezone : string = "UTC"
-
IANA timezone name (e.g., "Europe/Paris", "America/New_York").
- $throwable : bool = true
-
Whether to throw an exception on invalid timezone (default: true).
Tags
Return values
string —The AQL expression returning the date converted to UTC.