| Format pattern |
Description |
| D |
One day of the month. The date of one number does not have a leading zero. |
| Dd |
One day of the month. The date of a single number has a leading zero. |
| Ddd |
The abbreviated name of the day of the week, defined in Abbreviateddaynames. |
| dddd |
The full name of the day of the week, defined in DayNames. |
| M |
The number of months. A single number of months does not have a leading zero. |
| Mm |
The number of months. A one-digit month has a leading zero. |
| MMM |
The abbreviated name of the month, defined in AbbreviatedMonthNames. |
| MMMM |
The full name of the month, defined in MonthNames. |
| Y |
The year that does not contain eras. If the year that does not contain the era is less than 10, the year is displayed with no leading zeros. |
| Yy |
The year that does not contain eras. If the year that does not contain the era is less than 10, the year with leading zeros is displayed. |
| yyyy |
A four-digit year that includes the era. |
| Gg |
Period or era. If the date to be formatted does not have an associated period or era string, the pattern is ignored. |
| H |
12-hour hours. The number of hours in a single digit does not have a leading zero. |
| hh |
12-hour hours. The number of hours in a single digit has a leading zero. |
| H |
24-hour hours. The number of hours in a single digit does not have a leading zero. |
| HH |
24-hour hours. The number of hours in a single digit has a leading zero. |
| M |
Minutes, one number of minutes does not have a leading zero. |
| Mm |
Minutes, the number of minutes in one digit has a leading zero. |
| S |
Seconds, the number of seconds in a number does not have a leading zero. |
| Ss |
Seconds, a number of seconds has a leading zero. |
| F |
The decimal precision of the second is one digit. The remaining digits are truncated. |
| Ff |
The decimal precision of the second is two digits. The remaining digits are truncated. |
| Fff |
The decimal precision of the second is three digits. The remaining digits are truncated. |
| Ffff |
The decimal precision of the second is four digits. The remaining digits are truncated. |
| Fffff |
The decimal precision of the second is five digits. The remaining digits are truncated. |
| Ffffff |
The decimal precision of the second is six digits. The remaining digits are truncated. |
| Fffffff |
The decimal precision of the second is seven digits. The remaining digits are truncated. |
| T |
The am/pm defined in AMDesignator or PMDesignator indicates the first character of the item, if one exists. |
| Tt |
A am/pm indicator, if present, that is defined in AMDesignator or PMDesignator. |
| Z |
Time zone offset ("+" or "-" followed only by hours). The number of hours in a single digit does not have a leading zero. For example, the Pacific Standard Time is "-8". |
| Zz |
Time zone offset ("+" or "-" followed only by hours). The number of hours in a single digit has a leading zero. For example, the Pacific Standard Time is "-08". |
| zzz |
Full time zone offset ("+" or "-" followed by hours and minutes). The number of hours and minutes for a single digit has a leading zero. For example, the Pacific Standard Time is " -08:00". |
| : |
The default time separator that is defined in TimeSeparator. |
| / |
The default date separator that is defined in DateSeparator. |
| %c |
where c is the format pattern (if used alone). If the format pattern is merged with a literal character or another format pattern, you can omit the "%" character. |
| C |
where c is any character. Display characters according to the literal meaning. To display the backslash character, use "\". |