PHP localtime() Function
The localtime() function returns the local time. It
returns an array identical to the struct tm returned by the C function
localtime. It's different from getdate() in terms of the keys
returned.
Syntax
localtime(?int $timestamp = null, bool $associative = false): array
Parameters
associative: If set to false (default), it returns a regular, numerically indexed array. If set to true, it returns an associative array.
Try It Online
Output
Click Run to execute your code
Enjoying these tutorials?