Class: Duration
identity_wasm.Duration
A span of time.
Table of contents
Methods
Methods
toJSON
▸ toJSON(): Object
- Return copy of self without private attributes.
Returns
Object
▸ toJSON(): any
Serializes this to a JSON object.
Returns
any
toString
▸ toString(): string
Return stringified version of self.
Returns
string
seconds
▸ Static
seconds(seconds
): Duration
Create a new Duration with the given number of seconds.
Parameters
Name | Type |
---|---|
seconds | number |
Returns
minutes
▸ Static
minutes(minutes
): Duration
Create a new Duration with the given number of minutes.
Parameters
Name | Type |
---|---|
minutes | number |
Returns
hours
▸ Static
hours(hours
): Duration
Create a new Duration with the given number of hours.
Parameters
Name | Type |
---|---|
hours | number |
Returns
days
▸ Static
days(days
): Duration
Create a new Duration with the given number of days.
Parameters
Name | Type |
---|---|
days | number |
Returns
weeks
▸ Static
weeks(weeks
): Duration
Create a new Duration with the given number of weeks.
Parameters
Name | Type |
---|---|
weeks | number |
Returns
fromJSON
▸ Static
fromJSON(json
): Duration
Deserializes an instance from a JSON object.
Parameters
Name | Type |
---|---|
json | any |