How do I convert high resolution time to EST time in R?

49 views Asked by At

Data

I have high-resolution time matrices in 2 hdf5 files. I am sharing the first 6 rows of both:

highres1 <- structure(c(1146787039L, 1146950679L, 1147117707L, 1147288787L, 
                        1147455927L, 1147621801L, 30737659L, 30737659L, 30737659L, 30737659L, 
                        30737659L, 30737659L), .Dim = c(6L, 2L))

highres2 <- structure(c(14262704L, 14430686L, 14596509L, 14769601L, 14936074L, 
                     15103989L, 30732598L, 30732598L, 30732598L, 30732598L, 30732598L, 
                     30732598L), .Dim = c(6L, 2L))  

The data dictionary explains:

Array of two integers (4 bytes×2) that represent a 64-bit unsigned integer timestamp. The first integer represents the lower 4 bytes and the second the upper 4 bytes.

Goal:

I want to convert them to EST (Eastern Time). So, I can do the following:

library(anytime)
> anytime(highres1[,1])
[1] "2006-05-04 19:57:19 EDT" "2006-05-06 17:24:39 EDT" "2006-05-08 15:48:27 EDT"
[4] "2006-05-10 15:19:47 EDT" "2006-05-12 13:45:27 EDT" "2006-05-14 11:50:01 EDT"  

> anytime(highres1[,2])
[1] "1970-12-22 13:14:19 EST" "1970-12-22 13:14:19 EST" "1970-12-22 13:14:19 EST"
[4] "1970-12-22 13:14:19 EST" "1970-12-22 13:14:19 EST" "1970-12-22 13:14:19 EST"

But the dates that I see here are not correct. I know for sure that this file was created on May 07, 2019 around 1 PM EST. Am I supposed to combine these 2 numbers from the columns of a matrix? Or is the data incorrect?

0

There are 0 answers