[R] as.Date(Sys.time()) returns tomorrow !

William Dunlap wdunlap at tibco.com
Fri Jun 20 05:10:36 CEST 2014


Is it a time zone issue?  I get:

R> Sys.time()
[1] "2014-06-19 20:09:25 PDT"
R> as.Date(Sys.time())
[1] "2014-06-20"
R> as.Date(Sys.time(),tz="US/Pacific")
[1] "2014-06-19"
R> as.Date(Sys.time(),tz="PDT")
[1] "2014-06-20"
Warning message:
In as.POSIXlt.POSIXct(x, tz = tz) : unknown timezone 'PDT'
Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Thu, Jun 19, 2014 at 7:22 PM, ce <zadig_1 at excite.com> wrote:
> Dear all,
>
>> Sys.time()
> [1] "2014-06-19 22:19:17.976818 EDT"
>
>> as.Date(Sys.time())
> [1] "2014-06-20"
>>
>
>
> why this happens ?
>
> ______________________________________________
> 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