[R] TimeZone Help - Finding TimeZone codes

stephen sefick ssefick at gmail.com
Mon Nov 10 21:11:09 CET 2008


I have looked at
?as.POSIXct
?POSIXct
and many of the references that are on those pages.

I am bewildered with timezones.  Is there a way to get what would go
into tz="" for making a function that uses POSIXct to be able to be
used in all of the timezones in just the united states?  This is for
both windows and mac...
this is the function that I am wanting to use it with

library(maptools)
sunrise.set <- function(lat, long, date, timezone="UTC", num.days=1){
       #this needs to be long lat#
       lat.long <- matrix(c(long, lat), nrow=1)
       day <- as.POSIXct(date, tz=timezone)
       sequence <- seq(from=day, length.out=num.days , by="days")
       sunrise <- sunriset(lat.long, sequence, direction="sunrise",
POSIXct=TRUE)
       sunset <- sunriset(lat.long, sequence, direction="sunset", POSIXct=TRUE)
       ss <- data.frame(sunrise, sunset)
       ss <- ss[,-c(1,3)]
       colnames(ss)<-c("sunrise", "sunset")
       return(ss)
 }



thanks in advance,

-- 
Stephen Sefick
Research Scientist
Southeastern Natural Sciences Academy

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

								-K. Mullis



More information about the R-help mailing list