Represents a time interval.

Hierarchy (view full)

Constructors

  • Initializes a new instance of the System.TimeSpan structure to a specified number of hours, minutes, and seconds.

    Parameters

    • hours: number | Int32

      Number of hours.

    • minutes: number | Int32

      Number of minutes.

    • seconds: number | Int32

      Number of seconds.

    Returns TimeSpan

Accessors

  • get Days(): number
  • Gets the days component of the time interval represented by the current System.TimeSpan structure.

    Returns number

    The day component of this instance. The return value can be positive or negative.

  • get Hours(): number
  • Gets the hours component of the time interval represented by the current System.TimeSpan structure.

    Returns number

    The hour component of the current System.TimeSpan structure. The return value ranges from -23 through 23.

  • get Milliseconds(): number
  • Gets the milliseconds component of the time interval represented by the current System.TimeSpan structure.

    Returns number

    The millisecond component of the current System.TimeSpan structure. The return value ranges from -999 through 999.

  • get Minutes(): number
  • Gets the minutes component of the time interval represented by the current System.TimeSpan structure.

    Returns number

    The minute component of the current System.TimeSpan structure. The return value ranges from -59 through 59.

  • get Seconds(): number
  • Gets the seconds component of the time interval represented by the current System.TimeSpan structure.

    Returns number

    The second component of the current System.TimeSpan structure. The return value ranges from -59 through 59.

  • get Ticks(): number
  • Gets the number of ticks that represent the value of the current System.TimeSpan structure.

    Returns number

    The number of ticks contained in this instance.

  • get TotalDays(): number
  • Gets the value of the current System.TimeSpan structure expressed in whole and fractional days.

    Returns number

    The total number of days represented by this instance.

  • get TotalHours(): number
  • Gets the value of the current System.TimeSpan structure expressed in whole and fractional hours.

    Returns number

    The total number of hours represented by this instance.

  • get TotalMilliseconds(): number
  • Gets the value of the current System.TimeSpan structure expressed in whole and fractional milliseconds.

    Returns number

    The total number of milliseconds represented by this instance.

  • get TotalMinutes(): number
  • Gets the value of the current System.TimeSpan structure expressed in whole and fractional minutes.

    Returns number

    The total number of minutes represented by this instance.

  • get TotalSeconds(): number
  • Gets the value of the current System.TimeSpan structure expressed in whole and fractional seconds.

    Returns number

    The total number of seconds represented by this instance.

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.

  • 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.