Bug timeSeries 270.76.1 - [ ] Message is from an unknown sender

Yohan Chalabi chalabi at phys.ethz.ch
Sat Nov 8 08:44:27 CET 2008


>>>> "DA" == Daniele Amberti <daniele.amberti at ors.it>
>>>> on Wed, 5 Nov 2008 16:52:12 +0100

   DA> Yes, below You can find some code that make problem clear:
   DA> 
   DA> 
   DA> library(timeSeries)
   DA> MyTZ <- Sys.getenv("TZ")
   DA> 
   DA> Sys.setenv(TZ = "")
   DA> Sys.getenv("TZ")
   DA> # The problem is in timeSequence in a call to "strptime(charvec, isoFormat)" without the timezone.
   DA> # look for  [2008-03-30 02:00:00]
   DA> tseq <- timeSequence( from = '2008-03-29', to = '2008-03-31', by = "hour", zone = "GMT")
   DA> timeSeries(1:length(tseq), as.character(tseq),)
   DA> 
   DA> Sys.setenv(TZ = "GMT")
   DA> Sys.getenv("TZ")
   DA> # The problem is in timeSequence in a call to "strptime(charvec, isoFormat)" without the timezone.
   DA> # look for  [2008-03-30 02:00:00]
   DA> tseq <- timeSequence( from = '2008-03-29', to = '2008-03-31', by = "hour", zone = "GMT")
   DA> timeSeries(1:length(tseq), as.character(tseq),)
   DA> 
   DA> Sys.setenv(TZ = MyTZ)

Hi Daniele,

thanks for the clarification.

All calls in timeDate to strptime are now done with the argument
tz="GMT". Moreover, I changed the S3 method seq,timeDate to make it
similar to seq.POSIXt.

I have also added RUnit tests which corresponds to your report.

You can find the new code at R-Forge

svn co svn://svn.r-forge.r-project.org/svnroot/rmetrics/pkg/timeDate

Please have a look at it and let me know what you think.

Regards
Yohan

-- 
PhD student
Swiss Federal Institute of Technology
Zurich

www.ethz.ch



More information about the Rmetrics-core mailing list