Dear R-helpers,

I have a problem converting an object made with the 'chron' function
to a POSIXct object:

# Make date based on DOY
dat <- chron(dates=232, origin.=c(month=1, day=1, year=2008))

dat
#[1] 08/20/08

# Converting to POSIXct uses current timezone (Sydney):
as.POSIXct(dat)
#[1] "2008-08-20 10:00:00 EST"

# Setting GMT timezone has no effect?
as.POSIXct(dat, tz="GMT")
#[1] "2008-08-20 10:00:00 EST"

# But to POSIXlt works fine:
as.POSIXlt(dat, tz="GMT")
#[1] "2008-08-20 GMT"

Is this behavior expected? If so, can you explain why?

thanks for your help,
Remko



-------------------------------------------------
Remko Duursma
Post-Doctoral Fellow

Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753

Dept of Biological Science
Macquarie University
North Ryde NSW 2109
Australia

Mobile: +61 (0)422 096908

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to