Re: [R] rendering date/times from 64bit julian format?

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Wed 04 Oct 2006 - 13:21:55 GMT

Derek Eder <derek.eder@lungall.gu.se> writes:

> Hellos,
>
> I have date/times in 64-bit Julian format, that is the number of
> milliseconds since 1 jan 1970 (or something like that). E.g.,
> "1159884877406"
>
> For the life of me I can't figure out how to render these in a more
> readable format, e.g., "2006-10-04 23:12:93.191" (and I have tried to
> do my best searching the archives and help etc ...)
>

This should be close:

> format(ISOdatetime(1970,1,1,0,0,0)+1159884877406/1000,"%Y-%m-%d %H:%M:%OS3")
[1] "2006-10-03 15:14:37.406"

Beware the timezone issues though.

-- 
   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  FAX: (+45) 35327907

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed Oct 04 23:24:28 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 04 Oct 2006 - 14:30:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.