Export (0) Print
Expand All

Hour, Minute, and Second Format Pictures

This topic describes the format types for strings used to compose the format picture for a time string. Each format picture consists of a combination of one string of each of the format types.

Note  In the format types, the letters "m", "s", and "t" must be lowercase, and the letter "h" must be lowercase to denote the 12-hour clock or uppercase ("H") to denote the 24-hour clock.

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

StringMeaning
hHours without leading zeros for single-digit hours (12-hour clock).
hhHours with leading zeros for single-digit hours (12-hour clock).
HHours without leading zeros for single-digit hours (24-hour clock).
HHHours with leading zeros for single-digit hours (24-hour clock).

 

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

StringMeaning
mMinutes without leading zeros for single-digit minutes.
mmMinutes with leading zeros for single-digit minutes.

 

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

StringMeaning
sSeconds without leading zeros for single-digit seconds.
ssSeconds with leading zeros for single-digit seconds.

 

The following table defines the format types used to represent a time marker.

StringMeaning
tOne-character time marker string.

Note  You are recommended not to use this format for certain languages, for example, Japanese (Japan). With this format, an application always takes the first character from the time marker string, defined by LOCALE_S1159 (AM) and LOCALE_S2359 (PM). Because of this, the application can create incorrect formatting with the same string used for both AM and PM.

ttMulti-character time marker string.

 

 

 

Community Additions

ADD
Show:
© 2014 Microsoft