

The CultureInfo returned by CultureInfo.CurrentCulture has a CultureInfo.DateTimeFormat property that represents the current culture. Properties of a DateTimeFormatInfo describe the date and time separators, the names of months, days, and eras, and the format for the "AM" and "PM" designations. The current DateTimeFormatInfo object provides more control over how text should be interpreted as a date and time. For more information, see the articles on standard date and time format strings and custom date and time format strings. The ParseExact and TryParseExact methods convert a string representation that conforms to the pattern specified by a date and time format string. The Parse and TryParse methods convert many common representations of a date and time. You can specify how missing components in the text representation are set in the date and time.You can specify the culture for the format of a date time.You must specify the expected format of the text representing a date and time.There are three subtasks to correctly converting text into a DateTime: The methods that convert strings to DateTime objects enable you to provide detailed information about the formats you expect and the elements of a date and time your application needs.

Still others need to specify both the date and time. Some time representations use a 24-hour clock, others specify "AM" and "PM." Some applications need only the date. Different cultures use different orders for day, month, and year. Parsing strings to convert them to DateTime objects requires you to specify information about how the dates and times are represented as text.
