Constructor
new NetworkTimestamp(timestamp)
Creates a timestamp.
Parameters:
Name | Type | Description |
---|---|---|
timestamp |
number | Raw network timestamp. |
- Source:
Members
isEpochal
Determines if this is the epochal timestamp.
- Source:
Methods
(static) fromDatetime(referenceDatetime, epochTime) → {NetworkTimestamp}
Creates a network timestamp from a datetime.
Parameters:
Name | Type | Description |
---|---|---|
referenceDatetime |
Date | Reference date. |
epochTime |
Date | Custom network start time (undefined to use mainnet start time). |
- Source:
Returns:
Network timestamp representing the reference date.
- Type
- NetworkTimestamp
(static) fromDatetime(referenceDatetime, epochTime) → {NetworkTimestamp}
Creates a network timestamp from a datetime.
Parameters:
Name | Type | Description |
---|---|---|
referenceDatetime |
Date | Reference date. |
epochTime |
Date | Custom network start time (undefined to use mainnet start time). |
- Source:
Returns:
Network timestamp representing the reference date.
- Type
- NetworkTimestamp
addHours(count) → {NetworkTimestamp}
Adds a specified number of hours to this timestamp.
Parameters:
Name | Type | Description |
---|---|---|
count |
number | Number of hours to add. |
- Source:
Returns:
New timestamp that is the specified number of hours past this timestamp.
- Type
- NetworkTimestamp
addMilliseconds(count) → {NetworkTimestamp}
Adds a specified number of milliseconds to this timestamp.
Parameters:
Name | Type | Description |
---|---|---|
count |
number | Number of milliseconds to add. |
- Source:
Returns:
New timestamp that is the specified number of milliseconds past this timestamp.
- Type
- NetworkTimestamp
addMinutes(count) → {NetworkTimestamp}
Adds a specified number of minutes to this timestamp.
Parameters:
Name | Type | Description |
---|---|---|
count |
number | Number of minutes to add. |
- Source:
Returns:
New timestamp that is the specified number of minutes past this timestamp.
- Type
- NetworkTimestamp
(abstract) addSeconds(count) → {NetworkTimestamp}
Adds a specified number of seconds to this timestamp.
Parameters:
Name | Type | Description |
---|---|---|
count |
number | Number of seconds to add. |
- Source:
Returns:
New timestamp that is the specified number of seconds past this timestamp.
- Type
- NetworkTimestamp
addSeconds(count) → {NetworkTimestamp}
Adds a specified number of seconds to this timestamp.
Parameters:
Name | Type | Description |
---|---|---|
count |
number | Number of seconds to add. |
- Source:
Returns:
New timestamp that is the specified number of seconds past this timestamp.
- Type
- NetworkTimestamp
addSeconds(count) → {NetworkTimestamp}
Adds a specified number of seconds to this timestamp.
Parameters:
Name | Type | Description |
---|---|---|
count |
number | Number of seconds to add. |
- Source:
Returns:
New timestamp that is the specified number of seconds past this timestamp.
- Type
- NetworkTimestamp
toDatetime(epochTime) → {Date}
Converts this timestamp to a datetime.
Parameters:
Name | Type | Description |
---|---|---|
epochTime |
Date | Custom network start time (undefined to use mainnet start time). |
- Source:
Returns:
Date representation of this timestamp.
- Type
- Date
toDatetime(epochTime) → {Date}
Converts this timestamp to a datetime.
Parameters:
Name | Type | Description |
---|---|---|
epochTime |
Date | Custom network start time (undefined to use mainnet start time). |
- Source:
Returns:
Date representation of this timestamp.
- Type
- Date
toString() → {string}
Returns string representation of this object.
- Source:
Returns:
String representation of this object
- Type
- string