RadCalendar for ASP.NET

Time format string Send comments on this topic.
See Also
Time Picker > Time format string

Glossary Item Box

A custom Time format string consists of one or more custom Time format specifiers, and that format string defines the text representation of a DateTime object that is produced by a formatting operation.

 

Custom Time format specifiers. 

h Represents the hour as a number from 1 through 12, that is, the hour as represented by a 12-hour clock that counts the whole hours since midnight or noon. Consequently, a particular hour after midnight is indistinguishable from the same hour after noon. The hour is not rounded, and a single-digit hour is formatted without a leading zero. For example, given a time of 5:43, this format specifier displays "5". For more information about using a single format specifier, see Using Single Custom Format Specifiers.
hh, hh (plus any number of additional "h" specifiers) Represents the hour as a number from 01 through 12, that is, the hour as represented by a 12-hour clock that counts the whole hours since midnight or noon. Consequently, a particular hour after midnight is indistinguishable from the same hour after noon. The hour is not rounded, and a single-digit hour is formatted with a leading zero.
H Represents the hour as a number from 0 through 23, that is, the hour as represented by a zero-based 24-hour clock that counts the hours since midnight. A single-digit hour is formatted without a leading zero.
HH, HH (plus any number of additional "H" specifiers) Represents the hour as a number from 00 through 23, that is, the hour as represented by a zero-based 24-hour clock that counts the hours since midnight. A single-digit hour is formatted with a leading zero.
m Represents the minute as a number from 0 through 59. The minute represents whole minutes passed since the last hour. A single-digit minute is formatted without a leading zero.
mm, mm (plus any number of additional "m" specifiers) Represents the minute as a number from 00 through 59. The minute represents whole minutes passed since the last hour. A single-digit minute is formatted with a leading zero.
s Represents the seconds as a number from 0 through 59. The second represents whole seconds passed since the last minute. A single-digit second is formatted without a leading zero.
ss, ss (plus any number of additional "s" specifiers) Represents the seconds as a number from 00 through 59. The second represents whole seconds passed since the last minute. A single-digit second is formatted with a leading zero.
t Represents the first character of the A.M./P.M. designator defined in the current System.Globalization.DateTimeFormatInfo.AMDesignator or System.Globalization.DateTimeFormatInfo.PMDesignator property. The A.M. designator is used if the hour in the time being formatted is less than 12; otherwise, the P.M. designator is used.
tt, tt (plus any number of additional "t" specifiers) Represents the A.M./P.M. designator as defined in the current System.Globalization.DateTimeFormatInfo.AMDesignator or System.Globalization.DateTimeFormatInfo.PMDesignator property. The A.M. designator is used if the hour in the time being formatted is less than 12; otherwise, the P.M. designator is used.


Standard Time Format Specifiers

t ShortTimePattern - For example, the custom format string for the invariant culture is "HH:mm".
T LongTimePattern - For example, the custom format string for the invariant culture is "HH:mm:ss".
  

Using Time Format Strings

The following code fragment illustrates how to create time formatted strings. This example assumes that the current culture is English-United States (en-US).

 

ASPX Copy Code
<rad:RadTimePicker ID="RadTimePicker1" runat="server">
  
<TimeView TimeFormat="t">
  
</TimeView>
</
rad:RadTimePicker>

 

 

 

See Also