[Rd] Conversion and rounding of POSIXct

Dirk Eddelbuettel edd at debian.org
Sun Mar 15 18:04:22 CET 2009


Two really quick comments:

a) you need to enable sub-second print formats
b) AFAIK pre-epoch times are second-class citizens

R> options("digits.secs"=6)   ## print with 6 digits for microseconds
R> t0 <- as.POSIXct('1974-01-05 23:59:59.00001')
R> t0
[1] "1974-01-05 23:59:59.00001 CST"
R> as.POSIXlt(t0)
[1] "1974-01-05 23:59:59.00001 CST"
R> as.POSIXct(as.POSIXlt(t0)) - t0
Time difference of 0 secs

All that said, POSIXt is still under-documented and rather mysterious so I
won't / can't comment on all aspects of your post but the above should shed
some light on the first few items.

Hth, Dirk

Three out of two people have difficulties with fractions.

More information about the R-devel mailing list