The following %-prepended standard POSIX sequences can be used in date format strings:
| sequence |
meaining |
range |
| %b |
abbreviated month name |
Jan...Dec |
| %B |
full month name |
January...December |
| %d |
day of the month as a decimal number, 0-padded |
01...31 |
| %e |
day of the month as a decimal number, blank-padded |
1...31 |
| %E |
day of the month as a decimal number |
1...31 |
| %f |
English ordinal suffix for the day of the month |
st, nd, rd, th |
| %H |
hour in 24-hour format, 0-padded |
00...23 |
| %I |
hour in 12-hour format, 0-padded |
01...12 |
| %k |
hour in 24-hour format, blank-padded |
0...23 |
| %l |
hour in 12-hour format, blank-padded |
1...12 |
| %m |
month as a decimal number, 0-padded |
01...12 |
| %M |
minute, 0-padded |
00...60 |
| %p |
lowercase ante/post meridiem |
am, pm |
| %P |
uppercase ante/post meridiem |
AM, PM |
| %Y |
year as a decimal number including the century |
...2005... |