Can someone, please, explain the difference is results below (notice the isdst value)> unlist(as.POSIXlt('2005-7-1'))sec min hour mday mon year wday yday isdst 0 0 0 1 6 105 5 181 1> unlist(as.POSIXlt(as.Date('2005-7-1')))sec min hour mday mon year wday yday isdst 0 0 0 1 6 105 5 181 0
See the Avoiding Errors section of the Help Desk article in R News 4/1. On 10/6/05, Omar Lakkis <uofiowa at gmail.com> wrote:> Can someone, please, explain the difference is results below (notice > the isdst value) > > > unlist(as.POSIXlt('2005-7-1')) > sec min hour mday mon year wday yday isdst > 0 0 0 1 6 105 5 181 1 > > unlist(as.POSIXlt(as.Date('2005-7-1'))) > sec min hour mday mon year wday yday isdst > 0 0 0 1 6 105 5 181 0 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >
On Thu, 6 Oct 2005, Omar Lakkis wrote:> Can someone, please, explain the difference is results below (notice > the isdst value)Timezones. (That is carefully documented on the help page for as.POSIXlt.)>> unlist(as.POSIXlt('2005-7-1')) > sec min hour mday mon year wday yday isdst > 0 0 0 1 6 105 5 181 1This is midnight on 2005-07-01 in your timezone, which presumably does have DST and it was in force then.>> unlist(as.POSIXlt(as.Date('2005-7-1'))) > sec min hour mday mon year wday yday isdst > 0 0 0 1 6 105 5 181 0This is midnight on 2005-07-01 in UTC (which does not have DST). -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595