Hi Brian,

This is really odd.  I keep getting the NA secs answer, only by running
these three lines of code in a new session.


> time3=strptime("2009 06 01 00 47 00",format="%Y %m %d %H %M")
> time4=strptime("2009 06 01 00 57 00",format="%Y %m %d %H %M")
> diff(c(time3,time4))
Time difference of NA secs

Here is the information you requested:

> dput(time3)
structure(list(sec = 0, min = 47L, hour = 0L, mday = 1L, mon = 5L,
    year = 109L, wday = 1L, yday = 151L, isdst = -1L), .Names = c("sec",
"min", "hour", "mday", "mon", "year", "wday", "yday", "isdst"
), class = c("POSIXt", "POSIXlt"))
> dput(time4)
structure(list(sec = 0, min = 57L, hour = 0L, mday = 1L, mon = 5L,
    year = 109L, wday = 1L, yday = 151L, isdst = -1L), .Names = c("sec",
"min", "hour", "mday", "mon", "year", "wday", "yday", "isdst"
), class = c("POSIXt", "POSIXlt"))
> sessionInfo()
R version 2.11.0 (2010-04-22)
i386-pc-mingw32

locale:
[1] LC_COLLATE=Icelandic_Iceland.1252  LC_CTYPE=Icelandic_Iceland.1252
[3] LC_MONETARY=Icelandic_Iceland.1252 LC_NUMERIC=C
[5] LC_TIME=Icelandic_Iceland.1252

attached base packages:
[1] grDevices datasets  splines   graphics  stats     tcltk     utils
[8] methods   base

other attached packages:
[1] svSocket_0.9-48 TinnR_1.0.3     R2HTML_2.0.0    Hmisc_3.7-0.1
[5] survival_2.35-8

loaded via a namespace (and not attached):
[1] cluster_1.12.3 grid_2.11.0    lattice_0.18-5 svMisc_0.9-57
tools_2.11.0

Thanks,

Julian

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org 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.

Reply via email to