Skip to content

Instantly share code, notes, and snippets.

@infotroph
Created December 4, 2014 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infotroph/28bd34eabcaee9e600b8 to your computer and use it in GitHub Desktop.
Save infotroph/28bd34eabcaee9e600b8 to your computer and use it in GitHub Desktop.
Where are the decimal seconds stored?
> options(digits.secs=NULL)
> a = as.POSIXct("2014-12-04 09:18:27")
> b = as.POSIXct("2014-12-04 09:18:27.12345")
> a
[1] "2014-12-04 09:18:27 CST"
> b
[1] "2014-12-04 09:18:27 CST"
> options(digits.secs=6)
> a
[1] "2014-12-04 09:18:27 CST"
> b
[1] "2014-12-04 09:18:27.12345 CST"
> unclass(a)
[1] 1417706307
attr(,"tzone")
[1] ""
> unclass(b)
[1] 1417706307
attr(,"tzone")
[1] ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment