mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
The following methods are available directly under the RippleAPI object, not under schemaValidator: isValidAddress, isValidSecret, deriveKeypair, deriveAddress
28 lines
759 B
Plaintext
28 lines
759 B
Plaintext
## iso8601ToRippleTime
|
|
|
|
`iso8601ToRippleTime(iso8601: string): number`
|
|
|
|
This method parses a string representation of a date, and returns the number of seconds since the "Ripple Epoch" of January 1, 2000 (00:00 UTC).
|
|
|
|
The Ripple Epoch is 946684800 seconds after the Unix Epoch.
|
|
|
|
This method is useful for creating timestamps to use with the rippled APIs. The rippled APIs represent time as an unsigned integer of the number of seconds since the Ripple Epoch.
|
|
|
|
### Parameters
|
|
|
|
`iso8601`: A string representing a date and time. This string is parsed using JavaScript's `Date.parse()` method.
|
|
|
|
### Return Value
|
|
|
|
The number of seconds since the Ripple Epoch.
|
|
|
|
### Example
|
|
|
|
```javascript
|
|
api.iso8601ToRippleTime('2017-02-17T15:04:57Z');
|
|
```
|
|
|
|
```json
|
|
540659097
|
|
```
|