PHP getdate() Function

6 Jan 2025 | 1 min read

This getdate() function is used to get the information of the current local date/time or the timestamp.

Syntax

Parameters

ParameterDescriptionRequired/Optional
timestampSpecifies an integeroptional

Return

This function returns an associative array of information related to the timestamp.

Example 1

Output:

 Thursday, August 2, 2018 

Example 2

Output:

 Array ( [seconds] => 14 [minutes] => 7 [hours] => 7 [mday] => 9 [wday] => 4 [mon] => 8 [year] => 2018 [yday] => 220 [weekday] => Thursday [month] => August [0] => 1533798434 ) Thursday, August 9, 2018