PHP Date Format Cheat Sheet

Please consult the original documentation for examples and more information.
Usage Example:
$format = “‘l M j, y \a\t g:iA’”;
date($format, strtotime($date_str)

Result: “Thursday Nov 29, 07 at 2:09PM”

Format Character
Description
Example returned values

Hour

H
24-hour format of an hour with leading zeros
00 through 23

G
24-hour format of an hour without leading zeros
0 through 23

h
12-hour format of an hour with leading zeros
01 through 12

g
12-hour […]

Read the rest of PHP Date Format Cheat Sheet