: |
Time separator In some locales, other characters may be used to represent the time separator. The time separator separates hours, minutes, and seconds when time values are formatted. The actual character that is used as the time separator in formatted output is determined by your application's current culture value. |
/ |
Date separator In some locales, other characters may be used to represent the date separator. The date separator separates the day, month, and year when date values are formatted. The actual character that is used as the date separator in formatted output is determined by your application's current culture. |
% |
Used to indicate that the following character should be read as a single-letter format without regard to any trailing letters. Also used to indicate that a single-letter format is read as a user-defined format. See what follows for additional details . |
d |
Displays the Day as a number without a leading zero For example, 2 Use %d if this is the only character in your user-defined numeric format. |
dd |
Displays the Day as a number with a leading zero For example, 02 |
ddd |
Displays the Day as an abbreviation For example, Sun |
dddd |
Displays the Day as a full name For example, Sunday |
M |
Displays the Month as a number without a leading zero For example, 3 Use %M if this is the only character in your user-defined numeric format. |
MM |
Displays the Month as a number with a leading zero For example, 03 |
MMM |
Displays the Month as an abbreviation For example, Mar |
MMMM |
Displays the Month as a full month name For example, March |
y |
Displays the Year as a number without leading zeros. For exmaple, 8 Use %y if this is the only character in your user-defined numeric format. |
yy |
Displays the Year in two-digit numeric format with a leading zero, if applicable. For example, 08 |
yyy |
Displays the year in four-digit numeric format. For example, 2008 |
yyyy |
Displays the year in four-digit numeric format. For example, 2008 |
gg |
Displays the period/era string For example, A.D. |
h |
Displays the Hour as a number without leading zeros using the 12-hour clock For example, 4 Use %h if this is the only character in your user-defined numeric format. |
hh |
Displays the Hour as a number with leading zeros using the 12-hour clock For example, 04 |
H |
Displays the Hour as a number without leading zeros using the 24-hour clock For example, 16 Use %H if this is the only character in your user-defined numeric format. |
HH |
Displays the Hour as a number with leading zeros using the 24-hour clock For example, 16 |
m |
Displays the Minute as a number without leading zeros For example, 7 Use %m if this is the only character in your user-defined numeric format. |
mm |
Displays the Minute as a number with leading zeros For example, 07 |
s |
Displays the Second as a number without leading zeros For example, 4 Use %s if this is the only character in your user-defined numeric format. |
ss |
Displays the Second as a number with leading zeros For example, 04 |
f |
Displays fractions of seconds. For example ff displays hundredths of seconds, whereas ffff displays ten-thousandths of seconds. You may use up to seven f symbols in your user-defined format. Use %f if this is the only character in your user-defined numeric format. |
t |
Uses the 12-hour clock and displays an uppercase 'A' for any hour before noon; displays an uppercase ''P'' for any hour between noon and 11:59 P.M. For example, P Use %t if this is the only character in your user-defined numeric format. |
tt |
For locales that use a 12-hour clock, displays an uppercase 'AM' with any hour before noon; displays an uppercase 'PM' with any hour between noon and 11:59 P.M. For example, PM For locales that use a 24-hour clock, displays nothing. |
z |
Displays the timezone offset without a leading zero For example, +0 Use %z if this is the only character in your user-defined numeric format. |
zz |
Displays the timezone offset with a leading zero For example, +00 |
zzz |
Displays the full timezone offset For example, +00:00 |
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by PezMat