Learn R Programming

pawacc (version 1.1)

tsFromEpoch: Calculate timestamp from epoch number or epoch number from timestamp

Description

Utility functions.

Usage

tsFromEpoch(object, x)
epochFromTS(object, x)

Arguments

object
an object of class accfile.
x
either an integer giving the epoch number or the timestamp in a POSIX format (e.g., '%Y-%m-%d %H:%M:%S').

Value

  • either a timestamp corresponding to an epoch number or the epoch number corresponding to a timestamp.

See Also

gt1m.accfile

Examples

Run this code
data(gt1m_sample)

tsFromEpoch(gt1m_sample, 10000)
# [1] "2011-12-10 01:39:45 GMT"

epochFromTS(gt1m_sample, as.POSIXlt(strptime('2011-12-10 01:39:45', '%Y-%m-%d %H:%M:%S')))
# [1] 10000

Run the code above in your browser using DataLab