(PHP 4, PHP 5, PHP 7, PHP 8)
getdate — Get date/time information
   Returns an associative array containing the date
   information of the timestamp, or the current
   local time if timestamp is omitted or null.
  
   Returns an associative array of information related to
   the timestamp. Elements from the returned 
   associative array are as follows:
  
| Key | Description | Example returned values | 
|---|---|---|
| "seconds" | Numeric representation of seconds | 0to59 | 
| "minutes" | Numeric representation of minutes | 0to59 | 
| "hours" | Numeric representation of hours | 0to23 | 
| "mday" | Numeric representation of the day of the month | 1to31 | 
| "wday" | Numeric representation of the day of the week | 0(for Sunday) through6(for Saturday) | 
| "mon" | Numeric representation of a month | 1through12 | 
| "year" | A full numeric representation of a year, 4 digits | Examples: 1999or2003 | 
| "yday" | Numeric representation of the day of the year | 0through365 | 
| "weekday" | A full textual representation of the day of the week | SundaythroughSaturday | 
| "month" | A full textual representation of a month, such as January or March | JanuarythroughDecember | 
| 0 | Seconds since the Unix Epoch, similar to the values returned by time() and used by date(). | System Dependent, typically -2147483648through2147483647. | 
| Version | Description | 
|---|---|
| 8.0.0 | timestampis nullable now. | 
Example #1 getdate() example
<?php
$today = getdate();
print_r($today);The above example will output something similar to:
Array
(
    [seconds] => 40
    [minutes] => 58
    [hours] => 21
    [mday] => 17
    [wday] => 2
    [mon] => 6
    [year] => 2003
    [yday] => 167
    [weekday] => Tuesday
    [month] => June
    [0] => 1055901520
)
