- I
Remarks
This is a convertible type that can be used with the following notation(s) in parameter lists, parameter objects or setters.
There are some string formats that are converted to TimeSpan. For example:
'1s'
'0.5m'
'1h'
'1h 20m'
'1:20'
'1:20:30.5'It is also possible to use a which will be interpreted in milliseconds.
See Also
Developer's Guide
Members
Constructors
Parameters
- ticks: number
- The length of the time span in milliseconds.
Parameters
- days: number
- The days part of the time span.
- hours: number
- The hour part of the time span.
- minutes: number
- The minute part of the time span.
- seconds: number
- The seconds part of the time span.
- millis: number
- The milliseconds part of the time span.
Properties
Methods
Parameters
- obj: any
- The object to compare this to.
Return Value
- number
- -1: this is less than
obj - 0: this is equal to
obj - 1: this is greater than
obj
- -1: this is less than
Implements
IComparable.compareToParameters
- obj: any
- the other object to compare for equality
Return Value
- boolean
trueifobjis considered equal to this instance.
The hash code is a numeric value that can be used to treat this object as a key in a hash table or similar data structure.
Two objects that are considered equal must have the same hash code. However, the reverse does not hold and two objects having the same hash code don't have to be equal. Ideally, the hash code should be roughly uniformly-distributed to prevent hash tables from performing poorly. Calculating the hash code is also a potentially frequent operation and should therefore be fast.
Return Value
- number
- the hash code for this object
Constants
A timespan with duration Number.MAX_SAFE_INTEGER.
A timespan with duration zero.
Static Methods
Creates a new time span with the given length in milliseconds.
Parameters
- milliseconds: number
- The length of the time span in milliseconds.
Return Value
- TimeSpan
- A newly created time span.
Creates a new time span with the given length in minutes.
Parameters
- minutes: number
- The length of the time span in minutes.
Return Value
- TimeSpan
- A newly created time span.