now.php
Table of Contents
Functions
- now() : string
- Returns the current date/time as a formatted string.
Functions
now()
Returns the current date/time as a formatted string.
now([string $timezone = 'UTC' ][, string|null $format = 'Y-m-dTH:i:s.vZ' ]) : string
Parameters
- $timezone : string = 'UTC'
-
The timezone identifier (e.g., 'Europe/Paris'). Defaults to 'UTC'.
- $format : string|null = 'Y-m-dTH:i:s.vZ'
-
The date format string compatible with DateTime::format(). Defaults to 'Y-m-d\TH:i:s.v\Z' (ISO 8601 UTC with milliseconds).
Tags
Return values
string —The formatted current date/time string.