Hi.

I am new to POSIX and I'd like to understand the reason of this difference.

dt1 = as.POSIXct("2014-03-29 09.00", format="%Y-%m-%d %H.%M")
dt2 = as.POSIXct("2014-03-30 09.00", format="%Y-%m-%d %H.%M")
dt2-dt1

> dt1[1] "2014-03-29 09:00:00 CET"> dt2[1] "2014-03-30 09:00:00 CEST"> dt2-dt1

Time difference of 23 hours

This is right, because on Mar 31 at 2 PM we jump directly to 3PM, DST.

On the contrary, I don't understand the following:

dt1 = as.POSIXct("2014-04-18 09.00", format="%Y-%m-%d %H.%M", tz = "CEST")
dt2 = as.POSIXct("2014-04-18 09.00", format="%Y-%m-%d %H.%M", tz = "GMT")

> dt1[1] "2014-04-18 09:00:00 CEST"> dt2[1] "2014-04-18 09:00:00 GMT"> 
> dt1-dt2Time difference of 0 secs


I should expected a time difference of 2 hours, as CEST is GMT+2.

Anyone can help me?

Thank you,
Nicola

        [[alternative HTML version deleted]]

______________________________________________
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