Day, Month, Year, and Era Format Pictures

The application uses the elements described in this topic to construct a null-terminated format picture string. If spaces are used to separate the elements in the string, these spaces will appear in the same location in the output string.

Note  The format types "d", "g", and "y" must be lowercase and the letter "M" must be uppercase.

For example, to get the date string "Wed, Aug 31 94", the application uses the picture string "ddd',' MMM dd yy".

The application uses single quotation marks to mark characters to display exactly as specified. If the application must display a single quotation mark, it should place two single quotation marks in a row. For example, 'abc''bar', is displayed as "abc'bar".

The following table defines the format types used to represent days.

Format typeMeaning
dDay of the month as digits without leading zeros for single-digit days.
ddDay of the month as digits with leading zeros for single-digit days.
dddAbbreviated day of the week as specified by a LOCALE_SABBREVDAYNAME* value, for example, "Mon" in English (United States).

Windows Vista and later: If a short version of the day of the week is required, your application should use the LOCALE_SSHORTESTDAYNAME* constants.

ddddDay of the week as specified by a LOCALE_SDAYNAME* value.

 

The following table defines the format types used to represent months.

Format typeMeaning
MMonth as digits without leading zeros for single-digit months.
MMMonth as digits with leading zeros for single-digit months.
MMMAbbreviated month as specified by a LOCALE_SABBREVMONTHNAME* value, for example, "Nov" in English (United States).
MMMMMonth as specified by a LOCALE_SMONTHNAME* value, for example, "November" for English (United States), and "Noviembre" for Spanish (Spain).

 

The following table defines the format types used to represent years.

Format typeMeaning
yYear represented only by the last digit.
yyYear represented only by the last two digits. A leading zero is added for single-digit years.
yyyyYear represented by a full four or five digits, depending on the calendar used. Thai Buddhist and Korean calendars have five-digit years. The "yyyy" pattern shows five digits for these two calendars, and four digits for all other supported calendars. Calendars that have single-digit or two-digit years, such as for the Japanese Emperor era, are represented differently. A single-digit year is represented with a leading zero, for example, "03". A two-digit year is represented with two digits, for example, "13". No additional leading zeros are displayed.
yyyyyBehaves identically to "yyyy".

 

The following table defines the format types used to represent a period or era.

Format typeMeaning
g, ggPeriod/era string formatted as specified by the CAL_SERASTRING value. The "g" and "gg" format pictures in a date string are ignored if there is no associated era or period string.

 

 

 

Community Additions

ADD
Show:
© 2014 Microsoft