SiteTime final class
Minn\Runtime\SiteTime · public/minn/src/Minn/Runtime/SiteTime.php · 90 lines
Time as the site keeps it: its timezone (the named one, else the UTC offset), now in that zone or in UTC, a moment written in the site's language, and a stored date read back in a format.
Public
| static | zoneName(): string# | The site's timezone as text (wp_timezone_string): its name, else its offset as +HH:MM. |
| static | zone(): DateTimeZone# | The site's timezone (wp_timezone). |
| static | now(mixed $type, mixed $gmt = false): mixed# | Now (current_time): a timestamp for "timestamp" or "U" (the site's offset added unless in UTC), a database date for "mysql", else the format given, in the site's zone or UTC. |
| static | toGmt(mixed $date, mixed $format = 'Y-m-d H:i:s'): string# | A date in the site's zone written in UTC (get_gmt_from_date); the epoch for one that is not a date. |
| static | fromGmt(mixed $date, mixed $format = 'Y-m-d H:i:s'): string# | A date in UTC written in the site's zone (get_date_from_gmt); the epoch for one that is not a date. |
| static | format(mixed $format, mixed $timestamp = NULL, mixed $timezone = NULL): mixed# | A moment written in a format, its names in the site's language (wp_date), as the filter leaves it. |
| static | fromStored(mixed $format, mixed $date, mixed $translate = true): mixed# | A stored date in a format (mysql2date): false for none or one that is not a date; "G" and "U" are timestamps (G with the site's offset); the names translated unless asked not to be. |
Nothing matches.