Web Analytics

PHP getdate() Function

Date/Time FunctionPHP 4+

The getdate() function returns an array with date and time information for a given timestamp or the current time if no timestamp is given.

Syntax

getdate(?int $timestamp = null): array

Return Value

Returns an associative array containing date and time information, such as seconds, minutes, hours, mday, wday, mon, year, yday, weekday, and month.

Try It Online

Output
Click Run to execute your code

Related Functions