Cheatography
https://cheatography.com
Years
y |
Represents the year as at most a two-digit number. If the year has more than two digits, only the two low-order digits appear in the result. If the year has fewer than two digits, the number is formatted without a leading zero. |
yy |
Represents the year as a two-digit number. If the year has more than two digits, only the two low-order digits appear in the result. If the year has fewer than two digits, the number is padded with leading zeroes to achieve two digits. |
yyy |
Represents the year as a three-digit number. If the year has more than three digits, only the three low-order digits appear in the result. If the year has fewer than three digits, the number is padded with leading zeroes to achieve three digits. Note that for the Thai Buddhist calendar, which can have five-digit years, this format specifier displays all five digits. |
yyyy |
Represents the year as a four-digit number. If the year has more than four digits, only the four low-order digits appear in the result. If the year has fewer than four digits, the number is padded with leading zeroes to achieve four digits. Note that for the Thai Buddhist calendar, which can have five-digit years, this format specifier renders all five digits. |
yyyyy |
Represents the year as a five-digit number. If the year has more than five digits, only the five low-order digits appear in the result. If the year has fewer than five digits, the number is padded with leading zeroes to achieve five digits. If there are additional "y" specifiers, the number is padded with as many leading zeroes as necessary to achieve the number of "y" specifiers. |
|
|
Months
M |
Represents the month as a number from 1 through 12. A single-digit month is formatted without a leading zero. |
MM |
Represents the month as a number from 01 through 12. A single-digit month is formatted with a leading zero. |
MMM |
Represents the abbreviated name of the month as defined in the current System.Globalization.DateTimeFormatInfo.AbbreviatedMonthNames property. |
MMMM |
Represents the full name of the month as defined in the current System.Globalization.DateTimeFormatInfo.MonthNames property. |
Days
d |
Represents the day of the month as a number from 1 through 31. A single-digit day is formatted without a leading zero. |
dd |
Represents the day of the month as a number from 01 through 31. A single-digit day is formatted with a leading zero. |
ddd |
Represents the abbreviated name of the day of the week as defined in the current System.Globalization.DateTimeFormatInfo.AbbreviatedDayNames property. |
dddd |
Represents the full name of the day of the week as defined in the current System.Globalization.DateTimeFormatInfo.DayNames property. |
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets