new RemoteDate(optionsopt)
Initializes a new instance of the class with optional remote date settings.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options | RemoteDateOptions | | <optional> |
- Source
Classes
Methods
dateNow() → {Date}
Returns the newly-created Date object which represents the current date and time as of the time of instantiation. The returned date's timestamp is the same as the number returned by remoteDate.now(). The Remote instance needs to be initialized once first via a constructor or remoteDate.setRemoteTime() before being able to use remoteDate.dateNow().
- Source
Returns:
- Type:
- Date
now() → {number}
Returns the number of milliseconds elapsed since the epoch, which is defined as the midnight at the beginning of January 1, 1970, UTC. The Remote instance needs to be initialized once first via a constructor or remoteDate.setRemoteTime() before being able to use remoteDate.now().
- Source
Returns:
- Type:
- number
setRemoteTime(options) → {void}
Synchronizes the internal state of the RemoteDate instance with a remote time source.
Parameters:
Name | Type | Description |
---|---|---|
options | SetRemoteTimeOptions |
- Source
Returns:
- Type:
- void