This project is read-only.
Standard DateTime format patterns

Pattern Description
d Short Date Pattern (12/28/2009)
D Long Date Pattern (Monday, December 28, 2009)
f Full date and time, long date and short time (Monday, December 28, 2009 2:40 PM)
F Full date and time, long date and long time (Monday, December 28, 2009 2:42:03 PM)
g General, short date and short time (12/28/2009 2:42 PM)
G General,short date and long time (12/28/2009 2:43:10 PM)
m, M Month Day Pattern (December 28)
t Short Time Pattern (2:45 PM)
T Long Time Pattern (2:45:55 PM)
U Full date and time, long date and long time, using universal time (Monday, December 28, 2009 10:46:20 AM)
y,Y Year Month Pattern (December, 2009)


Custom DateTime format patterns

Pattern Description
%d The day of the month. Single-digit days do not have a leading zero.
dd The day of the month. Single-digit days have a leading zero.
ddd The abbreviated name of the day of the week
dddd The full name of the day of the week, as defined in DayNames.
gg The period or era.
%h The hour in a 12-hour clock. Single-digit hours do not have a leading zero.
hh The hour in a 12-hour clock. Single-digit hours have a leading zero.
%H The hour in a 24-hour clock. Single-digit hours do not have a leading zero.
HH The hour in a 24-hour clock. Single-digit hours have a leading zero.
%m The minute. Single-digit minutes do not have a leading zero.
mm The minute. Single-digit minutes have a leading zero.
%M The numeric month. Single-digit months do not have a leading zero.
MM The numeric month. Single-digit months have a leading zero.
MMM The abbreviated name of the month.
MMMM The full name of the month.
%s The second. Single-digit seconds do not have a leading zero.
ss The second. Single-digit seconds have a leading zero.
%t The first character in the AM/PM designator
tt The AM/PM designator
%y The year without the century. If the year without the century is less than 10, the year is displayed with no leading zero.
yy The year without the century. If the year without the century is less than 10, the year is displayed with a leading zero.
yyy The year in three digits. If the year is less than 100, the year is displayed with a leading zero.
yyyy The year in four or five digits (depending on the calendar used), including the century.
%z The time zone offset ("+" or "-" followed by the hour only). Single-digit hours do not have a leading zero.
zz The time zone offset ("+" or "-" followed by the hour only). Single-digit hours have a leading zero.
zzz The full time zone offset ("+" or "-" followed by the hour and minutes). Single-digit hours and minutes have leading zeros.

Last edited Dec 28, 2009 at 11:12 AM by levdanielyan, version 1

Comments

No comments yet.