codehaven - php snippets - coding help
Generic filters
Exact matches only

Php Time / Date attributes (Complete list)

29th July 2013

Php - Dates & Time

php codehaven

Day
01 to 31 d
Mon to Sun D
1 to 31 j
Sunday through Saturday l (lowercase ‘L’)
1 (for Monday) through 7 (for Sunday) N
st, nd, rd or th. Works well with j S
0 (for Sunday) through 6 (for Saturday) w
0 through 365 z
Week
Example: 42 (the 42nd week in the year) W
Month
January through December F
01 through 12 m
Jan through Dec M
1 through 12 n
28 through 31 t
Year
1 if it is a leap year, 0 otherwise. L
Examples: 1999 or 2003 o
Examples: 1999 or 2003 Y
Examples: 99 or 03 y
Time
am or pm a
AM or PM A
000 through 999 B
1 through 12 g
0 through 23 G
01 through 12 h
00 through 23 H
00 to 59 (Minutes)
i
00 through 59 (Seconds)
s

Was this code snippet helpful?