[R] time zones from longitude, latitude, and date

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Sep 24 09:09:50 CEST 2013


On 23/09/2013 22:43, MacQueen, Don wrote:
> The very first response, from Jeff Newmiller, included a link
>     http://efele.net/maps/tz/world/
> which says it has offers a shapefile of timezones of the world.
>
> An outline of a solution, then it to
>
>    download the shapefile
>    load it into R
>    input your lat/long data into R
>    use the over() function in the sp package
>
> Of course there are many details amongst those steps; I would suggest
> r-sig-geo would be the place for help with those details.
>
> It remains to be seen whether the way in which the timezones are
> identified in that shapefile is compatible with how timezones are
> identified in R POSIXt classes (R uses the OS for this). Daylight savings
> time information is, I believe, provided by the OS for at least some time
> zones, but I don't know if its provided for all of them.

It needs to be.  That is why the tzone databases are so large and 
complex and change several times a year.

Actually, the info is provided by the OS except on Windows where the 
Olsen/IANA database is used (as it is by almost all other current OSes). 
  So timezone names are fairly portable.

I thought I read in this thread that these were recordings at sea: see 
the caveats at that URL (it only applies on land ...).


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



More information about the R-help mailing list