Easy Tutorial
❮ Pdostatement Getattribute Func Curl_Multi_Select ❯

PHP idate() Function

PHP Date/Time Reference Manual

Example

Formats the local time/date as an integer. Test all different formats:


Definition and Usage

The idate() function formats the local time/date as an integer.

Note: The idate() function only accepts a single character as the format parameter!

Syntax

Parameter Description
format Required. Specifies how the result should be returned: B - Swatch Beat/Internet Time<br> d - Day of the month<br> h - Hour (12-hour format)<br> H - Hour (24-hour format)<br> i - Minutes<br> I - Returns 1 if Daylight Saving Time is enabled, otherwise returns 0<br> L - Returns 1 if it is a leap year, otherwise returns 0<br> m - Numeric representation of the month<br> s - Seconds<br> t - Number of days in the month<br> U - Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT), same as time()<br> w - Day of the week (Sunday is 0)<br> W - ISO-8601 week number of year, weeks starting on Monday<br> y - Year (1 or 2 digits)<br> Y - Year (4 digits)<br> z - Day of the year<br> Z - Timezone offset in seconds
timestamp Optional. Specifies the Unix timestamp to format. Defaults to the current time (time()).

Technical Details

Return Value: Returns an integer formatted according to the specified format using the given timestamp.
PHP Version: 5+
--- ---
Changelog: PHP 5.1.0: Added E_STRICT and E_NOTICE timezone errors. <br>
--- ---
❮ Pdostatement Getattribute Func Curl_Multi_Select ❯