Trying to read an integer of seconds since the epoch directly into a datetime type column without having to convert it after reading. Can't seem to get read_csv, fread or vroom to do this. Anyone have a way? #rstats
4
3
4
Replying to @jaredlander
I would suspect you cannot as no reader can guess when seeing an `int` that you meant it as a delta relative to epoch. I would just read as `int` (or `numeric`) and convert as shown in the screenshot.

May 26, 2021 · 4:28 PM UTC

2
4
Replying to @eddelbuettel
Had a feeling that would be the case. I even thought about using strftime from awk before reading it in, but at that point I might as well use anytime.
1
This solution seems to fail if the values are too large.
1
1
A 32-bit integer has a limit on its range, but if you read my reply to @jaredlander you will note I already mentioned `numeric`. Which works fine, obviously. And we also have `int64` in `nanotime` if you want higher-resolution increments.
2
3