Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library

Date and Time Format Strings

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Date and time format strings control formatting operations in which a date and/or time is represented as a string. The date and time value can be represented by either a DateTime or a DateTimeOffset value.

Date and time format strings fall into two categories:

  • Standard DateTime format strings.

    Standard date and time format strings consist of one standard date and time format specifier. Each standard format specifier denotes a particular, commonly used string representation of a date and time.

  • Custom DateTime format strings.

    Custom date and time format strings consist of one or more custom numeric format specifiers. Combine custom date and time format specifiers to define an application-specific pattern that determines how date and time data is formatted

Date and time format strings are supported by the ToString method of the DateTime and DateTimeOffset types. Date and time format strings are also supported by the .NET Framework composite formatting feature, which is used by certain Write and WriteLine methods of the Console and StreamWriter classes, the String.Format method, and the StringBuilder.AppendFormat method.

© 2015 Microsoft