Returns a number formatted according to the given format string using the given integer timestamp or the current local time if no timestamp is given. In other words, timestamp is optional and defaults to the value of time().
|Swatch Beat/Internet Time|
|Day of the month|
|Hour (12 hour format)|
|Hour (24 hour format)|
|Days in current month|
|Seconds since the Unix Epoch - January 1 1970 00:00:00 GMT - this is the same as time()|
|Day of the week (|
|ISO-8601 week number of year, weeks starting on Monday|
|Year (1 or 2 digits - check note below)|
|Year (4 digits)|
|Day of the year|
|Timezone offset in seconds|
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().
Returns an integer.
Every call to a date/time function will generate a
if the time zone is not valid, and/or a
if using the system settings or the
variable. See also date_default_timezone_set()
$timestamp = strtotime('1st January 2004'); //1072915200
// this prints the year in a two digit format
// however, as this would start with a "0", it
// only prints "4"
echo idate('y', $timestamp);