PHP getdate() Function
PHP Date/Time Reference Manual
Example
Return date/time information for the current local date/time:
Run Example »
Definition and Usage
The getdate() function returns date/time information for a given timestamp or the current local date/time.
Syntax
getdate(
timestamp);
| Parameters | Description |
|---|---|
| timestamp | Optional. Specifies an integer Unix timestamp. Defaults to the current local time (time()). |
Technical Details
| Return Value: | Returns an associative array containing information related to the timestamp:
- [seconds] - Seconds
- [minutes] - Minutes
- [hours] - Hours
- [mday] - Day of the month
- [wday] - Day of the week
- [mon] - Month
- [year] - Year
- [yday] - Day of the year
- [weekday] - Name of the day of the week
- [month] - Name of the month
- [0] - Seconds since the Unix epoch
PHP Date/Time Reference Manual