Convert between memory units
QR code generator
PHP internationalisation example
Clock animation for multiple time zones
The PHP date() function can present dates in lots of different formats. This page helps you to build your own formats
| Format code | Format description | 2012-04-15T02:24:14+01:00 |
|---|---|---|
| d | Day of the month, 2 digits with leading zeros | 15 |
| D | A textual representation of a day, three letters | Sun |
| j | Day of the month without leading zeros | 15 |
| l | A full textual representation of the day of the week | Sunday |
| N | ISO-8601 numeric representation of the day of the week - 1 (for Monday) through 7 (for Sunday) | 7 |
| S | English ordinal suffix for the day of the month, 2 characters | th |
| w | Numeric representation of the day of the week - 0 (for Sunday) through 6 (for Saturday) | 0 |
| z | The day of the year (starting from 0) | 105 |
| W | ISO-8601 week number of year, weeks starting on Monday | 15 |
| F | A full textual representation of a month, such as January or March | April |
| m | Numeric representation of a month, with leading zeros - 01 through 12 | 04 |
| M | A short textual representation of a month, three letters | Apr |
| n | Numeric representation of a month, without leading zeros | 4 |
| t | Number of days in the given month | 30 |
| L | Whether it's a leap year | 1 |
| o | ISO-8601 year number - if the ISO week number (W) belongs to the previous or next year, that year is used instead | 2012 |
| Y | A full numeric representation of a year, 4 digits | 2012 |
| y | A two digit representation of a year | 12 |
| a | Lowercase Ante meridiem and Post meridiem | am |
| A | Uppercase Ante meridiem and Post meridiem | AM |
| B | Swatch Internet time | 100 |
| g | 12-hour format of an hour without leading zeros | 2 |
| G | 24-hour format of an hour without leading zeros | 2 |
| h | 12-hour format of an hour with leading zeros | 02 |
| H | 24-hour format of an hour with leading zeros | 02 |
| i | Minutes with leading zeros | 24 |
| s | Seconds, with leading zeros | 14 |
| u | Microseconds | 000000 |
| e | Timezone identifier | Europe/London |
| I | Whether or not the date is in daylight saving time 1 if Daylight Saving Time, 0 otherwise. | 1 |
| O | Difference to Greenwich time (GMT) in hours | +0100 |
| P | Difference to Greenwich time (GMT) with colon between hours and minutes | +01:00 |
| T | Timezone abbreviation | BST |
| Z | Timezone offset in seconds. The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. | 3600 |
| c | ISO 8601 date | 2012-04-15T02:24:14+01:00 |
| r | RFC 2822 formatted date | Sun, 15 Apr 2012 02:24:14 +0100 |
| U | Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) | 1334453054 |
| j M Y | Short date format | 15 Apr 2012 |
| Y-m-d | SQL date format | 2012-04-15 |