PHP idate() Function
PHP Date/Time Reference Manual
Example
Format a local time/date as an integer. Test all the different formats:
"; echo idate("d") . ""; echo idate("h") . "
"; echo idate("H") . "
"; echo idate("i") . "
"; echo idate("I") . "
"; echo idate("L") . "
"; echo idate("m") . "
"; echo idate("s") . "
"; echo idate("t") . "
"; echo idate("U") . "
"; echo idate("w") . "
"; echo idate("W") . "
"; echo idate("y") . "
"; echo idate("Y") . "
"; echo idate("z") . "
"; echo idate("Z") . "
"; ?>
Run Example »
Definition and Usage
The idate() function formats a local time/date as an integer.
**Note:** The idate() function accepts only one character as the format parameter!
Syntax
idate(
format,timestamp);
| Parameters | Description |
|---|---|
| format | Required. Specifies how to format the result:
|
Technical Details
| Return Value: | Returns an integer formatted according to the specified format using the given timestamp format. |
|---|---|
| PHP Version: | 5+ |
| Changelog: | PHP 5.1.0: E_STRICT and E_NOTICE time zone errors were added. |
PHP Date/Time Reference Manual