Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Guard against accidental time-zone conversion
- > dput(x)
- structure(1317830532, class = c("POSIXct", "POSIXt"), tzone = "GMT")
- > dput(c(x))
- structure(1317830532, class = c("POSIXct", "POSIXt"))
- > dput(list(x))
- list(structure(1317830532, class = c("POSIXct", "POSIXt"), tzone = "GMT"))
- > dput(unlist(list(x)))
- 1317830532
- x <- structure(1317830532, class = c("POSIXct", "POSIXt"),
- tzone = "GMT")
- y <- structure(1317830532+3600, class = c("POSIXct", "POSIXt"),
- tzone = "PST8PDT")
- x
- [1] "2011-10-05 16:02:12 GMT"
- y
- [1] "2011-10-05 10:02:12 PDT"
- strftime(c(x, y), format="%Y/%m/%d %H:%M:%S", tz="GMT")
- [1] "2011/10/05 16:02:12" "2011/10/05 17:02:12"
- strftime(c(x, y), format="%Y/%m/%d %H:%M:%S", tz="PST8PDT")
- [1] "2011/10/05 09:02:12" "2011/10/05 10:02:12"
- strftime(unlist(y), format="%Y/%m/%d %H:%M:%S", tz="PST8PDT")
- [1] "2011/10/05 10:02:12"
Add Comment
Please, Sign In to add comment