Skip to content
Back to formatted view

Raw Message

Message-ID: <1353069556.66048.YahooMailNeo@web142604.mail.bf1.yahoo.com>
Date: 2012-11-16T12:39:16Z
From: arun
Subject: lubridate concatenation issue
In-Reply-To: <1353033361.41227.YahooMailNeo@web39306.mail.mud.yahoo.com>

HI,
Sys.setenv(TZ="GMT")
?c(d)
#[1] "2011-12-31 GMT"

#or
Sys.setenv(TZ="UTC")
?c(d)
#[1] "2011-12-31 UTC"

Hope it helps.
A.K.





----- Original Message -----
From: Andre Zege <azege at yahoo.com>
To: "r-help at r-project.org" <r-help at r-project.org>
Cc: 
Sent: Thursday, November 15, 2012 9:36 PM
Subject: [R] lubridate concatenation issue

I took a look at Hadley's lubridate which seems a very neat package, but i am having a small problem with? concatenating lubridates to build vectors of it. Namely when function c( )? is applied to lubridate seems to change time to a local timezone in this particular case changing the date to previous one.?

> d<-ymd('20111231')
> d
[1] "2011-12-31 UTC"
> c(d)
[1] "2011-12-30 19:00:00 EST"



Is this the expected behavior and if yes, how could it be avoided for this function and the others that possibly do the same? I mean, i could create the date in my local timezone and avoid this, but if i don't do it, is there an option in environment or functions to avoid this from happening -- otherwise i need to watch out for nasty bugs.?


Thanks
Andre
??? [[alternative HTML version deleted]]


______________________________________________
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.