Class: NetworkTimestampDatetimeConverter

NetworkTimestampDatetimeConverter(epoch, timeUnits)

Provides utilities for converting between network timestamps and datetimes.

Constructor

new NetworkTimestampDatetimeConverter(epoch, timeUnits)

Creates a converter given an epoch and base time units.
Parameters:
Name Type Description
epoch Date Date at which network started.
timeUnits string Time unit the network uses for progressing.
Source:

Methods

toDatetime(rawTimestamp) → {Date}

Converts a network timestamp to a datetime.
Parameters:
Name Type Description
rawTimestamp number Raw network timestamp.
Source:
Returns:
Date representation of the network timestamp.
Type
Date

toDifference(referenceDatetime) → {number}

Subtracts the network epoch from the reference date.
Parameters:
Name Type Description
referenceDatetime Date Reference date.
Source:
Returns:
Number of network time units between the reference date and the network epoch.
Type
number