September 2001
Intermediate to advanced
768 pages
32h 45m
English
array getdate(int time) Gets date and time information for a UNIX timestamp.
Returns:
Array containing date/time information
Description:
getdate() creates an array of 10 elements containing most of the relevant information needed when formatting a date string. It can be very useful when combined with mktime() or date(). The array contains the following keys:
| Value | Description |
|---|---|
| seconds | Seconds |
| minutes | Minutes |
| hours | Hours |
| mday | Day of the month (numeric) |
| wday | Day of the week (numeric) |
| year | Year |
| yday | Day of the year (numeric) |
| weekday | Name of the weekday; for example, Tuesday |
| month | Name of the month; for example, April |
Version:
PHP 3, PHP 4
See also:
date() checkdate() mkdate()
Example:
$my_time = getdate(date('U')); ... |
Read now
Unlock full access