d | The day of the month, from 1 through 31. |
dd | The day of the month, from 01 through 31. |
ddd | The abbreviated name of the day of the week. |
dddd | The full name of the day of the week. |
h | The hour, using a 12-hour clock from 1 to 12. |
hh | The hour, using a 12-hour clock from 01 to 12. |
H | The hour, using a 24-hour clock from 0 to 23. |
HH | The hour, using a 24-hour clock from 00 to 23. |
K | Time zone information. |
mm | The minute, from 00 through 59. |
M | The month, from 1 through 12. |
MM | The month, from 01 through 12. |
MMM | The abbreviated name of the month. |
MMMM | The full name of the month. |
ss | The second, from 00 through 59. |
t | The first character of the AM/PM designator. |
tt | The AM/PM designator. |
yy | The year, from 00 to 99. |
yyyy | The year as a four-digit number. |
z | Hours offset from UTC, with no leading zeros. |
zz | Hours offset from UTC, with a leading zero for a single-digit value. |
zzz | Hours and minutes offset from UTC. |
: | The time separator. |
/ | The date separator. |
\ | Escape character. Use this to include one of the above special characters literally. For example, "\h" will output "h" instead of the hour. |