PHP Manual
Prev |  | Next

# getdate

(PHP 3, PHP 4 )

getdate -- Get date/time information

## Description

array getdate ( [int timestamp])

Returns an associative array containing the date information of the `timestamp`, or the current local time if no timestamp is given, as the following array elements:

- "seconds" - seconds

- "minutes" - minutes

- "hours" - hours

- "mday" - day of the month

- "wday" - day of the week, numeric : from 0 as Sunday up to 6 as Saturday

- "mon" - month, numeric

- "year" - year, numeric

- "yday" - day of the year, numeric; i.e. "299"

- "weekday" - day of the week, textual, full; i.e. "Friday"

- "month" - month, textual, full; i.e. "January"

Example 1. getdate() example
    $today = getdate();
    $month = $today['month'];
    $mday = $today['mday'];
    $year = $today['year'];
    echo "$month $mday, $year";

Prev | Home | Next
date | Up | gettimeofday