Represents a time interval
TimeSpan(timeSpan: TimeSpan)
Construct a TimeSpan object from another TimeSpan object
Parameters | |
timeSpan | another TimeSpan to copy values from |
TimeSpan(millis: number = 0)
Construct a TimeSpan object to the specified
Parameters | |
millis | The millisecond component |
TimeSpan(second: number = 0, millis: number = 0)
Construct a TimeSpan object to the specified
Parameters | |
second | The second component |
millis | The millisecond component |
TimeSpan(minute: number = 0, second: number = 0, millis: number = 0)
Construct a TimeSpan object to the specified
Parameters | |
minute | The minute component |
second | The second component |
millis | The millisecond component |
TimeSpan(hour: number = 0, minute: number = 0, second: number = 0, millis: number = 0)
Construct a TimeSpan object to the specified
Parameters | |
hour | The hour component |
minute | The minute component |
second | The second component |
millis | The millisecond component |
TimeSpan(day: number = 0, hour: number = 0, minute: number = 0, second: number = 0, millis: number = 0)
Construct a TimeSpan object to the specified
Parameters | |
day | The day component |
hour | The hour component |
minute | The minute component |
second | The second component |
millis | The millisecond component |
static TimeSpan fromDays(days: number)
Returns a TimeSpan that represents a specified number of days
Parameters | |
days | A number of days |
Return | |
TimeSpan | The TimeSpan |
static TimeSpan fromHours(hours: number)
Returns a TimeSpan that represents a specified number of hours
Parameters | |
hours | A number of hours |
Return | |
TimeSpan | The TimeSpan |
static TimeSpan fromMinutes(minutes: number)
Returns a TimeSpan that represents a specified number of minutes
Parameters | |
minutes | A number of minutes |
Return | |
TimeSpan | The TimeSpan |
static TimeSpan fromSeconds(seconds: number)
Returns a TimeSpan that represents a specified number of seconds
Parameters | |
seconds | A number of seconds |
Return | |
TimeSpan | The TimeSpan |
number days()
Gets the day component of this instance
Return | |
number | The day component |
number hours()
Gets the hour component of this instance
Return | |
number | The hour component |
number minutes()
Gets the minute component of this instance
Return | |
number | The minute component |
number seconds()
Gets the second component of this instance
Return | |
number | The second component |
number millis()
Gets the millisecond component of this instance
Return | |
number | The millisecond component |
number totalDays()
Return the total number of days in this TimeSpan
Return | |
number | Total number of days |
number totalHours()
Return the total number of hours in this TimeSpan
Return | |
number | Total number of hours |
number totalMinutes()
Return the total number of minutes in this TimeSpan
Return | |
number | Total number of minutes |
number totalSeconds()
Return the total number of seconds in this TimeSpan
Return | |
number | Total number of seconds |
number totalMillis()
Return the total number of milliseconds in this TimeSpan
Return | |
number | Total number of milliseconds |
number isNegative()
Return true if this TimeSpan is negative
Return | |
number | true if this TimeSpan is negative |
number isZero()
Return true if this TimeSpan is 0
Return | |
number | true if this TimeSpan is 0 |
TimeSpan add(timeSpan: TimeSpan)
Returns a copy of this TimeSpan with the specified timespan added
Parameters | |
timeSpan | The timespan to add to this one |
Return | |
TimeSpan | A copy of this TimeSpan with the timespan added |
TimeSpan addDays(days: number)
Returns a copy of this TimeSpan plus the specified number of days
Parameters | |
days | The amount of days to add, may be negative |
Return | |
TimeSpan | The new TimeSpan plus the increased days |
TimeSpan addHours(hours: number)
Returns a copy of this TimeSpan plus the specified number of hours
Parameters | |
hours | The amount of hours to add, may be negative |
Return | |
TimeSpan | The new TimeSpan plus the increased hours |
TimeSpan addMinutes(minutes: number)
Returns a copy of this TimeSpan plus the specified number of minutes
Parameters | |
minutes | The amount of minutes to add, may be negative |
Return | |
TimeSpan | The new TimeSpan plus the increased minutes |
TimeSpan addSeconds(seconds: number)
Returns a copy of this TimeSpan plus the specified number of seconds
Parameters | |
seconds | The amount of seconds to add, may be negative |
Return | |
TimeSpan | The new TimeSpan plus the increased seconds |
TimeSpan addMillis(milliseconds: number)
Returns a copy of this TimeSpan plus the specified number of milliseconds
Parameters | |
milliseconds | The amount of milliseconds to add, may be negative |
Return | |
TimeSpan | The new TimeSpan plus the increased milliseconds |
TimeSpan sub(timeSpan: TimeSpan)
Returns a copy of this TimeSpan with the specified timespan subtracted
Parameters | |
timeSpan | The TimeSpan to subtract to this one |
Return | |
TimeSpan | A copy of this TimeSpan with the timespan subtracted |
TimeSpan mul(multiplicand: TimeSpan)
Returns a new TimeSpan with this length multiplied by the specified multiplicand
Parameters | |
multiplicand | the multiplicand to multiply this one by |
Return | |
TimeSpan | A new TimeSpan with this length multiplied by the specified multiplicand |
TimeSpan div(divisor: TimeSpan)
Returns a new TimeSpan with this length divided by the specified divisor
Parameters | |
divisor | the divisor to divide this one by |
Return | |
TimeSpan | A new TimeSpan with this length divided by the specified divisor |
string format(pattern: string)
Output the instant using the specified format pattern
Parameters | |
pattern | The pattern specification, null means use (dd.hh:mm:ss) |
Return | |
string | The formatted string, not null |
© 2024 - Macrorify by KoK-CODE