Export (0) Print
Expand All

Standard DateTime Format Strings Output Examples

The following table illustrates the output created by applying some standard DateTime format strings to a particular date and time. Output was produced using the ToString method.

The Format specifier column indicates the format string, the Culture column indicates the culture associated with the current thread, and the Output column indicates the result of formatting.

The different culture values demonstrate the impact of changing the current culture. The culture can be changed by using the Date/Time control panel in Microsoft Windows, by passing your own DateTimeFormatInfo class as the format provider, or by passing a CultureInfo class set to a different culture. Note that changing the culture does not influence the output produced by the 'r' and 's' formats.

Format specifierCurrent cultureOutput
den-US4/10/2001
den-NZ10/04/2001
dde-DE10.04.2001
Den-USTuesday, April 10, 2001
Ten-US3:51:24 PM
Tes-ES15:51:24
fen-USTuesday, April 10, 2001 3:51 PM
ffr-FRmardi 10 avril 2001 15:51
ren-USTue, 10 Apr 2001 15:51:24 GMT
rzh-SGTue, 10 Apr 2001 15:51:24 GMT
sen-US2001-04-10T15:51:24
spt-BR2001-04-10T15:51:24
uen-US2001-04-10 15:51:24Z
usv-FI2001-04-10 15:51:24Z
men-USApril 10
mms-MY10 April
yen-USApril, 2001
yaf-ZAApril 2001
Len-UZUnrecognized format specifier; a format exception is thrown.

See Also

Formatting Overview | Formatting Types | Standard DateTime Format Strings | Custom DateTime Format Strings

Show:
© 2014 Microsoft