The DateTimeStyles
enumeration defines formatting options that customize string parsing for converting to a DateTime
value.
Name | Value | Description |
---|---|---|
None | 0 | Default behavior. No special formatting options are set. |
AllowWhiteSpaces | 1 | Allows white space characters in the parsed string. |
AssumeLocal | 2 | Assumes the date and time are local if no time zone is present. |
AssumeUniversal | 4 | Assumes the date and time are UTC if no time zone is present. |
AdjustToUniversal | 8 | Converts the parsed time to UTC. |
NoCurrentDateDefault | 16 | Prevents the parser from filling missing date parts with the current date. |
RoundtripKind | 128 | Preserves the DateTimeKind value when round‑tripping. |
AllowInnerWhiteSpace | 32 | Allows whitespace within the date and time components. |
AcceptTrailingWhiteSpace | 64 | Ignores trailing whitespace after the parsed string. |