[R] as.POSIXlt, starting at 0 or 18000?

Gabor Grothendieck ggrothendieck at gmail.com
Tue Sep 11 16:16:01 CEST 2007


This is what I get:

> unclass(strptime("1970-01-01", "%Y-%m-%d", tz="GMT") + 0)
[1] 0
attr(,"tzone")
[1] "GMT"
> unclass(strptime("1970-01-01", "%Y-%m-%d", tz="EST5EDT") + 0)
[1] 18000
attr(,"tzone")
[1] "EST5EDT"
> R.version.string # Windows Vista
[1] "R version 2.6.0 alpha (2007-09-06 r42791)"

so 1970-01-01 GMT is 0 and 1970-01-01 Eastern corresponds
to a GMT of 18000.

There is an article about dates and times in R News 4/1.

On 9/11/07, yoooooo <magno_yu at ml.com> wrote:
>
> Hi all,
>
>   I tried to do this:
>
> unclass(strptime("1970-01-01", "%Y-%m-%d", tz="") + 0)
> [1] 18000
>
>    I thought the starting time is zero? Same result returns if I do:
>
> unclass(strptime("1970-01-01", "%Y-%m-%d", tz="EDT") + 0)
> unclass(strptime("1970-01-01", "%Y-%m-%d", tz="EST") + 0)
> unclass(strptime("1970-01-01", "%Y-%m-%d", tz="GMT") + 0)
>
>    with LC_TIME=en_US;
>
>    Or they always start from 18000?
>
> Thanks,
> - yoooooo
>
> --
> View this message in context: http://www.nabble.com/as.POSIXlt%2C-starting-at-0-or-18000--tf4422770.html#a12615136
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list