This is not a bug. You asked for a difference of 1 day = 24 hours = 1440
minutes = 86400 seconds. And that is the difference you get.
> start <- as.POSIXct(strptime("20151025",format='%Y%m%d'))
> end <- start + as.difftime(1, unit="days")
> end - start
Time difference of 1 days
> as.integer(end) - as.integer(start)
ir. Thierry Onkelinx
Statisticus / Statistician
Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
[hidden email] Havenlaan 88 bus 73, 1000 Brussel
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
> I would like to report this date/time bug that threatened me for a long
> as I need correct date calculation in my computations.
> If I add 1 day to the light saving switching day, it will incorrectly
> subtract 1 hour from the date and missalign all my calculations.
> You can see it runing (I am testing it with Rome, Italy (+1) TimeZone)
> print(paste0("Horrible R Bug is present?
> ",strptime("20151025",format='%Y%m%d')+as.difftime(1, unit="days")));
> As you can see the output says 11pm and not 12pm !
> I do not know if it is a requested feature, but for me is unpleasant and
> unexpected behaviour.
> Thank you very much!
> [[alternative HTML version deleted]]
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel >