Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TimeSpan

Represents a time interval.

constructor

TimeSpan

param

Number of days.

param

Number of hours.

param

Number of minutes.

param

Number of seconds.

param

Number of milliseconds.

ignore

Hierarchy

  • TimeSpan

Index

Constructors

constructor

  • new TimeSpan(days: number, hours: number, minutes: number, seconds: number, milliseconds: number): TimeSpan

Properties

Protected _ticks

_ticks: number

Static maxValue

maxValue: TimeSpan = TimeSpan.fromTicks(Number.MAX_SAFE_INTEGER)

Static minValue

minValue: TimeSpan = TimeSpan.fromTicks(Number.MIN_SAFE_INTEGER)

Static zero

zero: TimeSpan = new TimeSpan(0, 0, 0, 0, 0)

Methods

add

  • Returns a new TimeSpan object whose value is the sum of the specified TimeSpan object and this instance.

    memberof

    TimeSpan

    instance

    Parameters

    • ts: TimeSpan

      The time interval to add.

    Returns TimeSpan

compareTo

  • compareTo(value: TimeSpan): 1 | -1 | 0
  • Compares this instance to a specified object and returns an integer that indicates whether this instance is shorter than, equal to, or longer than the specified object.

    memberof

    TimeSpan

    instance

    Parameters

    • value: TimeSpan

      The time interval to add.

    Returns 1 | -1 | 0

days

  • days(): number

duration

  • Returns a new TimeSpan object whose value is the absolute value of the current TimeSpan object.

    memberof

    TimeSpan

    instance

    Returns TimeSpan

equals

  • Returns a value indicating whether this instance is equal to a specified object.

    memberof

    TimeSpan

    instance

    Parameters

    • value: TimeSpan

      The time interval to check for equality.

    Returns boolean

hours

  • hours(): number

milliseconds

  • milliseconds(): number

negate

seconds

  • seconds(): number

subtract

  • Returns a new TimeSpan object whose value is the difference of the specified TimeSpan object and this instance.

    memberof

    TimeSpan

    instance

    Parameters

    • ts: TimeSpan

      The time interval to subtract.

    Returns TimeSpan

ticks

  • ticks(): number

totalDays

  • totalDays(): number

totalHours

  • totalHours(): number

totalMilliseconds

  • totalMilliseconds(): number

totalMinutes

  • totalMinutes(): number

totalSeconds

  • totalSeconds(): number

Static additionDoesOverflow

  • additionDoesOverflow(a: number, b: number): boolean

Static compare

Static fromDays

Static fromHours

Static fromMilliseconds

  • fromMilliseconds(value: number): TimeSpan

Static fromMinutes

Static fromSeconds

Static fromTicks

Static interval

  • interval(value: number, scale: number): TimeSpan

Static isTimeSpan

  • isTimeSpan(timespan: TimeSpan): number

Static subtractionDoesUnderflow

  • subtractionDoesUnderflow(a: number, b: number): boolean

Generated using TypeDoc