Module: EpochUtil

Helper module that provides utility methods for parsing properties/attributes that contain Epoch times.

Source:

Methods

(static) toLocalTime(epochTime) → {Date}

Converts the specified Epoch time to a Date (in local time).

Parameters:
Name Type Description
epochTime Number

Time as an Epoch time

Source:
Returns:
  • Time as a Date (in local time).
Type
Date
Example
var entRep = reputationsObj[FileProvider.ENTERPRISE]
var entRepAttribs = entRep[FileReputationProp.ATTRIBUTES]
var localTime = EpochUtil.toLocalTime(
  entRepAttribs[FileEnterpriseAttrib.FIRST_CONTACT])

(static) toLocalTimeString(epochTime) → {String}

Converts the specified Epoch time to a local time string.

Parameters:
Name Type Description
epochTime Number

Time as an Epoch time

Source:
Returns:
  • Time as a string (in local time)
Type
String
Example
var entRep = reputationsObj[FileProvider.ENTERPRISE]
var entRepAttribs = entRep[FileReputationProp.ATTRIBUTES]
var localTimeString = EpochUtil.toLocalTimeString(
  entRepAttribs[FileEnterpriseAttrib.FIRST_CONTACT])