When you write
I understand that the POSIXct view is less accurate than the POSIXlt view
you are simply mistaken.
This is the same view for both - up to a millisecond on Windows and up to (almost) microseconds on other OSs. Have you read help(DateTimeClasses) ?
As for your last question, yes, the development version of my RcppBDT package uses Boost Date.Time and can fully work in nanoseconds if your OS supports it and you enable the correct view. But it replaces POSIXct and does not yet support time object vectors.
Edit: Regarding your next question:
R> one <- Sys.time(); two <- Sys.time(); two - one Time difference of 7.43866e-05 secs R> R> as.POSIXlt(two) - as.POSIXlt(one) Time difference of 7.43866e-05 secs R> R> one
Edit 2: I think you are just experiencing that the floating point representation on computers is inaccurate:
R> print(as.numeric(as.POSIXct("04-Jan-2013 17:22:08.138", + format="%d-%b-%Y %H:%M:%OS")), digits=18) [1] 1357341728.13800001 R> print(as.numeric(as.POSIXct("04-Jan-2013 17:22:08.139", + format="%d-%b-%Y %H:%M:%OS")), digits=18) [1] 1357341728.13899994 R>
The difference is not exactly 1/1000 as you expected.
Dirk Eddelbuettel Mar 13 '13 at 11:45 2013-03-13 11:45
source share