.NET Date Formatter
Date Format Cheatsheet
Example date: 02 April 2006 15:04:05
Format
Description
Example
d
Day of the month (1-31)
2
dd
Day of the month (01-31)
02
ddd
Abbreviated day of the week
Sun
dddd
Full day of the week
Sunday
M
Month (1-12)
4
MM
Month (01-12)
04
MMM
Abbreviated month name
Apr
MMMM
Full month name
April
y
Year (1-digit)
2006
yy
Year (2-digits)
06
yyyy
Year (4-digits)
2006
h
Hour (12-hour, 1-12)
3
hh
Hour (12-hour, 01-12)
03
H
Hour (24-hour, 0-23)
15
HH
Hour (24-hour, 00-23)
15
m
Minute (0-59)
4
mm
Minute (00-59)
04
s
Second (0-59)
5
ss
Second (00-59)
05
t
Abbreviated AM/PM (A/P)
PM
tt
AM/PM
PM
z
Hours offset from UTC
+00
zz
Hours offset from UTC with leading zero
+0000
zzz
Hours and minutes offset from UTC
+00:00