major date function specifiers Flashcards
d
Day of the month, two digits, with leading zeros. 01 to 31
D
Day of the week, three letters. Mon to Sun
j
Day of the month, no leading zeros. 1 to 31
l
Day of week, full names. Sunday to Saturday
N
Day of week, numeric, Monday to Sunday. 1 to 7
S
Suffix for day of month (useful with specifier j) st, nd, rd, or th
w
Day of week, numeric, Sunday to Saturday. 0 to 6
z
Day of year. 0 to 365
W
Week number or year. 01 to 52
F
Month name. January to December
m
Month number with leading zeros. 01 to 12
M
Month name, three letters. Jan to Dec
n
Month number, no leading zeros 1 to 12
t
Number of days in given month. 28 to 31
L
Leap year. 1 = Yes, 0 = No
y
Year, 2 digits. 00 to 99
Y
Year, 4 digits 0000 to 9999
a
Before or after midday, lowercase. am or pm
A
Before or after midday, uppercase. AM or PM
g
Hour of day, 12-hour format, no leading zeros. 1 to 12
G
Hour of day, 24-hour format, no leading zeros. 00 to 23
h
Hour of day, 12-hour format, with leading zeros. 01 to 12
H
Hour of day, 24-hour format, with leading zeros. 00 to 23
i
Minutes, with leading zeros. 00 to 59
s
Seconds, with leading zeros 00 to 59