Copyright © tutorialspoint.com
| array getdate ( [int $timestamp] ); |
Returns a string formatted according to the given format string using the given integer timestamp or the current time if no timestamp is given. In other words, timestamp is optional and defaults to the value of time().
| Parameter | Description |
|---|---|
| timestamp | Optional. This 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(). |
Returns an associative array of information related to the typestamp. The returning array contains ten elements with relevant information needed when formatting a date string:
Following is the usage of this function:
<?php $today = getdate(); print_r($today); ?> |
This will produce following result:
Array
(
[seconds] => 40
[minutes] => 58
[hours] => 21
[mday] => 17
[wday] => 2
[mon] => 6
[year] => 2003
[yday] => 167
[weekday] => Tuesday
[month] => June
[0] => 1055901520
)
|
Copyright © tutorialspoint.com