Skip to content

Daylight Saving Time

8 messages · Jeff Newmiller, Vasantha Kumar Kesavan, Brian Ripley

#
Hi,

I am working R on windows 2012 R2 platform, I have updated the latest
hotfixes for time zone information(Microsoft KB 2981580.
<http://support.microsoft.com/kb/2981580>).

But still R is not populating correct date time values(Standard and
Daylight saving).

Could you please advise me, how to enable R to pick up the latest time zone
information/configurations.

Example:

R --vanilla
Sys.setenv(TZ = "America/Eirunepe");
dt<-c(seq(as.POSIXct("2013-11-09 20:00:00",tz="America/Eirunepe"),
as.POSIXct("2013-11-10 10:00:00" ,tz="America/Eirunepe"), by="hour"));
[1] "2013-11-09 20:00:00 AMT" "2013-11-09 21:00:00 AMT"
 [3] "2013-11-09 22:00:00 AMT" "2013-11-09 23:00:00 AMT"
 [5] "2013-11-10 00:00:00 AMT" "2013-11-10 01:00:00 AMT"
 [7] "2013-11-10 02:00:00 AMT" "2013-11-10 03:00:00 AMT"
 [9] "2013-11-10 04:00:00 AMT" "2013-11-10 05:00:00 AMT"
[11] "2013-11-10 06:00:00 AMT" "2013-11-10 07:00:00 AMT"
[13] "2013-11-10 08:00:00 AMT" "2013-11-10 09:00:00 AMT"
[15] "2013-11-10 10:00:00 AMT"

For the ?*America/Eirunepe*? time zone, the DST ended on Sun 10-Nov-2013 at
12:00:00 A.M. when local clocks were set backward 1 hour.


as per the latest timezone configuration, the date time sequence should
have "2013-11-09 23:00:00" twice.


Thanks

Vasanth
#
R on Windows uses the Olsen timezone database, a copy of which is stored with R in the Program Files directory (e.g. R/R-3.1.1/share/zoneinfo). You could update the file yourself if you can find a corrected version, or download an updated version of R.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
On November 6, 2014 1:16:06 PM EST, Vasantha Kumar Kesavan <info.vasukv at gmail.com> wrote:
#
Thanks Jeff Newmiller, it is working now.

I would like to know, the same kind of configuration can be done in Linux
and Solaris platform.

Instead of R is mapping to operating system(/usr/share/. /usr/share/lib/)
zoneinfo directory.

Thanks
Vasanth

On Fri, Nov 7, 2014 at 1:18 AM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us>
wrote:

  
  
#
Working now... after what action?

AFAIK on *NIX systems R uses the OS installation of the Olsen database, so on a fresh login R should pick up any OS update you have installed.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
On November 6, 2014 3:36:38 PM EST, Vasantha Kumar Kesavan <info.vasukv at gmail.com> wrote:
#
In LINUX, I don't want R to use the operating system zoneinfo(Olsen
database) instead of that I like to point different path which has the
latest zoneinfo(latest Olsen database).

On Fri, Nov 7, 2014 at 2:34 AM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us>
wrote:

  
  
#
?timezones

You probably need to recompile R.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.
On November 6, 2014 4:10:58 PM EST, Vasantha Kumar Kesavan <info.vasukv at gmail.com> wrote:
#
I am Sorry for not explained my requirement to you properly.

As you told in Windows I need to update the $R_HOME/share/zoneinfo with the
latest time zone information, since R is not using the operating system
time zone files. Then I have updated the zoneinfo directory, after that it
is working fine for me in the windows.

In the linux platform by default R is using the operating system timezone
files available at "/usr/share/zoneinfo" path. Yesterday my question was is
it there are any way to configure the R to use different path
("/tmp/zoneinfo") instead of "/usr/share/zoneinfo".

Then from the internet I came to know that the TZDIR
(TZDIR="/tmp/zoneinfo") environment variable can be used for configure
different time zone path instead of the default path. By setting the TZDIR
environment variable in Linux does the need as I am expected. So my
requirement in Windows and Linux platform are worked out.

Now I like to know, how to do the same in Solaris operating system (when I
am tried with setting TZDIR environment variable as like Linux but no luck).

Thanks
Vasanth



On Fri, Nov 7, 2014 at 2:55 AM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us>
wrote:

  
  
#
On 07/11/2014 10:21, Vasantha Kumar Kesavan wrote:
Well, it is in the R help file: give credit where it is due!
Go back to the R manuals: the recommendation for recent R on Solaris is 
to use the tzcode included in R, for which TZDIR does work.

We can write the help and manuals for you, but it is your responsibility 
to do your own homework: see the posting guide.