Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
enum System.Globalization.DateTimeStyles
Assembly: System.Runtime
Defines the formatting options that customize string parsing for some date and time parsing methods.
Values
None
Default formatting options must be used. This value represents the default style for the <see cref="M:System.DateTime.Parse(System.String)" /> , <see cref="M:System.DateTime.ParseExact(System.String,System.String,System.IFormatProvider)" /> , and <see cref="M:System.DateTime.TryParse(System.String,System.DateTime@)" /> methods.
AllowLeadingWhite
Leading white-space characters must be ignored during parsing, except if they occur in the <see cref="T:System.Globalization.DateTimeFormatInfo" /> format patterns.
AllowTrailingWhite
Trailing white-space characters must be ignored during parsing, except if they occur in the <see cref="T:System.Globalization.DateTimeFormatInfo" /> format patterns.
AllowInnerWhite
Extra white-space characters in the middle of the string must be ignored during parsing, except if they occur in the <see cref="T:System.Globalization.DateTimeFormatInfo" /> format patterns.
AllowWhiteSpaces
Extra white-space characters anywhere in the string must be ignored during parsing, except if they occur in the <see cref="T:System.Globalization.DateTimeFormatInfo" /> format patterns. This value is a combination of the <see cref="F:System.Globalization.DateTimeStyles.AllowLeadingWhite" /> , <see cref="F:System.Globalization.DateTimeStyles.AllowTrailingWhite" /> , and <see cref="F:System.Globalization.DateTimeStyles.AllowInnerWhite" /> values.
NoCurrentDateDefault
If the parsed string contains only the time and not the date, the parsing methods assume the Gregorian date with year = 1, month = 1, and day = 1. If this value is not used, the current date is assumed.
AdjustToUniversal
Date and time are returned as a Coordinated Universal Time (UTC). If the input string denotes a local time, through a time zone specifier or <see cref="F:System.Globalization.DateTimeStyles.AssumeLocal" /> , the date and time are converted from the local time to UTC. If the input string denotes a UTC time, through a time zone specifier or <see cref="F:System.Globalization.DateTimeStyles.AssumeUniversal" /> , no conversion occurs. If the input string does not denote a local or UTC time, no conversion occurs and the resulting <see cref="P:System.DateTime.Kind" /> property is <see cref="F:System.DateTimeKind.Unspecified" /> . This value cannot be used with <see cref="F:System.Globalization.DateTimeStyles.RoundtripKind" /> .
AssumeLocal
If no time zone is specified in the parsed string, the string is assumed to denote a local time. This value cannot be used with <see cref="F:System.Globalization.DateTimeStyles.AssumeUniversal" /> or <see cref="F:System.Globalization.DateTimeStyles.RoundtripKind" /> .
AssumeUniversal
If no time zone is specified in the parsed string, the string is assumed to denote a UTC. This value cannot be used with <see cref="F:System.Globalization.DateTimeStyles.AssumeLocal" /> or <see cref="F:System.Globalization.DateTimeStyles.RoundtripKind" /> .
RoundtripKind
The <see cref="T:System.DateTimeKind" /> field of a date is preserved when a <see cref="T:System.DateTime" /> object is converted to a string using the "o" or "r" standard format specifier, and the string is then converted back to a <see cref="T:System.DateTime" /> object.