From josh.m.ulrich at gmail.com  Tue Mar 26 17:06:01 2013
From: josh.m.ulrich at gmail.com (Joshua Ulrich)
Date: Tue, 26 Mar 2013 11:06:01 -0500
Subject: [Rd] as.Date.POSIXct
Message-ID: <CAPPM_gSGmsqoGEgZN4t6aUWGt+fSKFeXUUvXu29AAXM2WOyBSw@mail.gmail.com>

Would it make sense for as.Date.POSIXct to not assume tz="UTC" if the
POSIXct object has a valid tzone attribute?  Current behavior may be
confusing in certain cases, for example:

> (d <- structure(1090450800, tzone="Europe/Berlin",
+ class=c("POSIXct","POSIXt")))
[1] "2004-07-22 01:00:00 CEST"
> as.Date(d)
[1] "2004-07-21"
> as.Date(as.POSIXlt(d))
[1] "2004-07-22"
> as.Date(d, tz=attr(d,'tzone'))
[1] "2004-07-22"

Best,
--
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com

R/Finance 2013: Applied Finance with R  | www.RinFinance.com



[Rd] as.Date.POSIXct
Joshua Ulrich