Defines the formatting options that customize string parsing for some date and time parsing methods.

Hierarchy (view full)

Properties

AdjustToUniversal: DateTimeStyles

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 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 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 System.DateTime.Kind property is System.DateTimeKind.Unspecified.

AllowInnerWhite: DateTimeStyles

Extra white-space characters in the middle of the string must be ignored during parsing, except if they occur in the System.Globalization.DateTimeFormatInfo format patterns.

AllowLeadingWhite: DateTimeStyles

Leading white-space characters must be ignored during parsing, except if they occur in the System.Globalization.DateTimeFormatInfo format patterns.

AllowTrailingWhite: DateTimeStyles

Trailing white-space characters must be ignored during parsing, except if they occur in the System.Globalization.DateTimeFormatInfo format patterns.

AllowWhiteSpaces: DateTimeStyles

Extra white-space characters anywhere in the string must be ignored during parsing, except if they occur in the System.Globalization.DateTimeFormatInfo format patterns. This value is a combination of the System.Globalization.DateTimeStyles.AllowLeadingWhite, System.Globalization.DateTimeStyles.AllowTrailingWhite, and System.Globalization.DateTimeStyles.AllowInnerWhite values.

AssumeLocal: DateTimeStyles

If no time zone is specified in the parsed string, the string is assumed to denote a local time.

AssumeUniversal: DateTimeStyles

If no time zone is specified in the parsed string, the string is assumed to denote a UTC.

NoCurrentDateDefault: DateTimeStyles

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.

Default formatting options must be used. This value represents the default style for the Parse(s), System.DateTime.ParseExact|ParseExact(s, format, provider), and TryParse(s, result) methods.

RoundtripKind: DateTimeStyles

The System.DateTimeKind field of a date is preserved when a 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 System.DateTime object.

Methods

  • Casts this object to the specified type. Throws error on failure.

    Type Parameters

    • T1

      The target type of the cast.

    • T2

      The type of the object to cast.

    Parameters

    Returns T1

  • Determines whether the specified object is equal to the current object.

    Parameters

    • obj: any

      The object to compare with the current object.

    Returns boolean

    true if the specified object is equal to the current object; otherwise, false.

  • Serves as the default hash function.

    Returns number

    A hash code for the current object.

  • Determines whether one or more bit fields are set in the current instance.

    Parameters

    • flag: Enum

      An enumeration value.

    Returns boolean

    true if the bit field or bit fields that are set in flag are also set in the current instance; otherwise, false.

  • Returns a string that represents the current object.

    Returns string

    A string that represents the current object.

  • Casts this object to the specified type. Returns null on failure.

    Type Parameters

    • T1

      The target type of the cast.

    • T2

      The type of the object to cast.

    Parameters

    Returns null | T1

  • Determines whether the specified object instances are considered equal.

    Parameters

    • objA: any

      The first object to compare.

    • objB: any

      The second object to compare.

    Returns boolean

    true if the objects are considered equal; otherwise, false. If both objA and objB are null, the method returns true.

Default capability

  • Perform And operation on enum values.

    Parameters

    • Rest...rest: Enum[]

      The other enum values.

    Returns this

    The result.

    2.0

  • Perform Or operation on enum values.

    Parameters

    • Rest...rest: Enum[]

      The other enum values.

    Returns this

    The result.

    2.0

  • Perform Xor operation on enum values.

    Parameters

    • Rest...rest: Enum[]

      The other enum values.

    Returns this

    The result.

    2.0