Export (0) Print
Expand All
0 out of 2 rated this helpful - Rate this topic

Date and Time Format Strings

DateTime format strings are used to control the formatting produced when a date or time is represented as a string.

The DateTime data type implements IFormattable, allowing it to be formatted as a string with one of the overloads of DateTime.ToString. The output of the standard format strings is influenced by the current culture. The standard .NET Framework format provider class is DateTimeFormatInfo, which can be obtained from a passed CultureInfo object or the one associated with the current thread.

DateTime format strings fall into two categories: standard format strings and custom format strings. The custom format strings allow DateTime objects to be formatted for situations where the standard formatting strings are not useful.

See Also

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.