GETDATE
Get date/time information
SYNTAX
getdate ([ int $timestamp = time() ] ) : array
PARAMETERS
timestamp
The optional timestamp parameter is an integer Unix timestamp that defaults to the current local time if a timestamp is not given. In other words, it defaults to the value of time().
RETURN
Returns an associative array of information related to the timestamp. Elements from the returned associative array are as follows:
KEY | DESCRIPTION | EXAMPLE |
---|---|---|
"seconds" | Numeric representation of seconds | 0 to 59 |
"minutes" | Numeric representation of minutes | 0 to 59 |
"hours" | Numeric representation of hours | 0 to 23 |
"mday" | Numeric representation of the day of the month | 1 to 31 |
"wday" | Numeric representation of the day of the week | 0 (for Sunday) through 6 (for Saturday) |
"mon" | Numeric representation of a month | 1 through 12 |
"year" | A full numeric representation of a year, 4 digits | Examples: 1999 or 2003 |
"yday" | Numeric representation of the day of the year | 0 through 365 |
"weekday" | A full textual representation of the day of the week | Sunday through Saturday |
"month" | A full textual representation of a month, such as January or March | January through December |
0 | Seconds since the Unix Epoch, similar to the values returned by time() and used by date(). | System Dependent, typically -2147483648 through 2147483647. |
EXAMPLES
VOID
Array
(
[seconds] => 19
[minutes] => 35
[hours] => 3
[mday] => 17
[wday] => 0
[mon] => 1
[year] => 2021
[yday] => 16
[weekday] => Sunday
[month] => January
[0] => 1610854519
)
TIMESTAMP
Array
(
[seconds] => 6
[minutes] => 5
[hours] => 4
[mday] => 3
[wday] => 6
[mon] => 2
[year] => 2001
[yday] => 33
[weekday] => Saturday
[month] => February
[0] => 981173106
)