Class: Timestamp
identity_wasm.Timestamp
Table of contents
Constructors
Methods
Constructors
constructor
• new Timestamp()
Creates a new Timestamp with the current date and time.
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
parse
▸ Static parse(input): Timestamp
Parses a Timestamp from the provided input string.
Parameters
| Name | Type |
|---|---|
input | string |
Returns
nowUTC
▸ Static nowUTC(): Timestamp
Creates a new Timestamp with the current date and time.
Returns
toRFC3339
▸ toRFC3339(): string
Returns the Timestamp as an RFC 3339 String.
Returns
string
checkedAdd
▸ checkedAdd(duration): undefined | Timestamp
Computes self + duration
Returns null if the operation leads to a timestamp not in the valid range for RFC 3339.
Parameters
| Name | Type |
|---|---|
duration | Duration |
Returns
undefined | Timestamp
checkedSub
▸ checkedSub(duration): undefined | Timestamp
Computes self - duration
Returns null if the operation leads to a timestamp not in the valid range for RFC 3339.
Parameters
| Name | Type |
|---|---|
duration | Duration |
Returns
undefined | Timestamp
fromJSON
▸ Static fromJSON(json): Timestamp
Deserializes an instance from a JSON object.
Parameters
| Name | Type |
|---|---|
json | any |