TimeSpan

TimeSpan

Represents a time interval.


Constructor

# new TimeSpan()

Classes

timeSpan

Methods

# (static) compare(t1, t2) → {number}

Compares two TimeSpan values, returning an integer that indicates their relationship.

Parameters:
Name Type Description
t1 TimeSpan

TimeSpan value

t2 TimeSpan

TimeSpan value

Returns:
Type
number

# (static) equals(t1, t2) → {Boolean}

Returns a value indicating whether two instances of TimeSpan are equal.

Parameters:
Name Type Description
t1 TimeSpan

TimeSpan value

t2 TimeSpan

TimeSpan value

Returns:

true if value is a TimeSpan object that represents the same time interval as the current TimeSpan object; otherwise, false.

Type
Boolean

# (static) fromDays(value) → {TimeSpan}

Returns a TimeSpan that represents a specified number of days, where the specification is accurate to the nearest millisecond.

Parameters:
Name Type Description
value number

number of days

Returns:

An object that represents value.

Type
TimeSpan

# (static) fromHours(value) → {TimeSpan}

Returns a TimeSpan that represents a specified number of hours, where the specification is accurate to the nearest millisecond.

Parameters:
Name Type Description
value number

number of hours

Returns:

An object that represents value.

Type
TimeSpan

# (static) fromMilliseconds(value) → {TimeSpan}

Returns a TimeSpan that represents a specified number of milliseconds.

Parameters:
Name Type Description
value number

number of milli seconds

Returns:

An object that represents value

Type
TimeSpan

# (static) fromMinutes(value) → {TimeSpan}

Returns a TimeSpan that represents a specified number of minutes, where the specification is accurate to the nearest millisecond.

Parameters:
Name Type Description
value number

number of minutes

Returns:

An object that represents value.

Type
TimeSpan

# (static) fromSeconds(value) → {TimeSpan}

Returns a TimeSpan that represents a specified number of seconds, where the specification is accurate to the nearest millisecond.

Parameters:
Name Type Description
value number

number of seconds

Returns:

An object that represents value.

Type
TimeSpan

# (static) fromTicks(value) → {TimeSpan}

Returns a TimeSpan that represents a specified time, where the specification is in units of ticks.

Parameters:
Name Type Description
value number

of ticks

Returns:

An object that represents value.

Type
TimeSpan

# (static) opAddition(t1, t2) → {TimeSpan}

Parameters:
Name Type Description
t1 TimeSpan

TimeSpan Class Object

t2 TimeSpan

TimeSpan Class Object

Returns:

TimeSpan Class Object

Type
TimeSpan

# (static) opEquality(t1, t2) → {Boolean}

Parameters:
Name Type Description
t1 TimeSpan

TimeSpan Class Object

t2 TimeSpan

TimeSpan Class Object

Returns:
Type
Boolean

# (static) opGreaterThan(t1, t2) → {Boolean}

Parameters:
Name Type Description
t1 TimeSpan

TimeSpan Class Object

t2 TimeSpan

TimeSpan Class Object

Returns:
Type
Boolean

# (static) opGreaterThanOrEqual(t1, t2) → {Boolean}

Parameters:
Name Type Description
t1 TimeSpan

TimeSpan Class Object

t2 TimeSpan

TimeSpan Class Object

Returns:
Type
Boolean

# (static) opInequality(t1, t2) → {Boolean}

Parameters:
Name Type Description
t1 TimeSpan

TimeSpan Class Object

t2 TimeSpan

TimeSpan Class Object

Returns:
Type
Boolean

# (static) opLessThan(t1, t2) → {Boolean}

Parameters:
Name Type Description
t1 TimeSpan

TimeSpan Class Object

t2 TimeSpan

TimeSpan Class Object

Returns:
Type
Boolean

# (static) opLessThanOrEqual(t1, t2) → {Boolean}

Parameters:
Name Type Description
t1 TimeSpan

TimeSpan Class Object

t2 TimeSpan

TimeSpan Class Object

Returns:
Type
Boolean

# (static) opSubtraction(t1, t2) → {TimeSpan}

Returns a new TimeSpan object whose value is the difference between the two specified TimeSpan object

Parameters:
Name Type Description
t1 TimeSpan

TimeSpan Class Object

t2 TimeSpan

TimeSpan Class Object

Returns:

A new time interval whose value is the result of the value of the two instances of ts

Type
TimeSpan

# (static) opUnaryNegation(t) → {TimeSpan}

Returns a new TimeSpan object whose value is the negated value of this instance.

Parameters:
Name Type Description
t TimeSpan

TimeSpan Class Object

Returns:

A new object with the same numeric value as this instance, but with the opposite sign.

Type
TimeSpan

# (static) opUnaryPlus(t) → {TimeSpan}

Returns a new TimeSpan object whose value is the sum of the two specified TimeSpan object.

Parameters:
Name Type Description
t TimeSpan

TimeSpan Class Object

Returns:

A new time interval whose value is the result of the value of the two instances of ts

Type
TimeSpan

# (static) subtractDate(from, to) → {TimeSpan}

Parameters:
Name Type Description
from Date

date object

to Date

data object

Returns:
Type
TimeSpan

# (static) timeToTicks(hour, minute, second) → {number}

Parameters:
Name Type Description
hour int

number of hours

minute int

number of minutes

second int

number of seconds

Returns:
Type
number

# add(t) → {TimeSpan}

Parameters:
Name Type Description
t TimeSpan

TimeSpan Class Object

Returns:
Type
TimeSpan

# compareTo(value) → {Number}

Parameters:
Name Type Description
value TimeSpan

TimeSpan Class Object

Returns:
Type
Number

# duration() → {TimeSpan}

Returns:

TimeSpan Class Object

Type
TimeSpan

# getDays() → {Number}

Returns:

njmber of days

Type
Number

# getHours() → {Number}

Returns:

number of hours

Type
Number

# getMilliseconds() → {Number}

Returns:

number of milli seconds

Type
Number

# getMinutes() → {Number}

Returns:

number of minutes

Type
Number

# getSeconds() → {Number}

Returns:

number of seconds

Type
Number

# getTotalDays() → {Number}

Returns:

number of total days

Type
Number

# getTotalHours() → {Number}

Returns:

number of total hours

Type
Number

# getTotalMilliseconds() → {Number}

Returns:

number of total milliseconds

Type
Number

# getTotalMinutes() → {Number}

Returns:

number of total minutes

Type
Number

# getTotalSeconds() → {Number}

Returns:

number of total seconds

Type
Number

# subtract(ts) → {TimeSpan}

Parameters:
Name Type Description
ts TimeSpan

TimeSpan Class Object

Returns:
Type
TimeSpan

# toEquals(t1) → {Boolean}

Returns a value indicating whether two instances of TimeSpan are equal.

Parameters:
Name Type Description
t1 TimeSpan

TimeSpan value

Returns:

true if value is a TimeSpan object that represents the same time interval as the current TimeSpan structure; otherwise, false.

Type
Boolean