tidyverse / hms

A simple class for storing time-of-day values
https://hms.tidyverse.org/
Other
138 stars 25 forks source link

parse_hm("12:34") shouldn't equal "13:34:00" #50

Closed wdenton closed 7 years ago

wdenton commented 7 years ago
ℝ> library(hms) 
ℝ> packageVersion("hms")
[1] ‘0.3.0.9003’
ℝ> parse_hm("12:34")
13:34:00
ℝ> as.difftime(as.character("1:00"), format = "%H:%M", units = "secs")
Time difference of 3600 secs
ℝ> as.difftime(as.character("2:00"), format = "%H:%M", units = "secs")
Time difference of 10800 secs

I encountered the problem when adding up hours with hms, but it is something in base R? This is with R 3.4.2 on Ubuntu 17.04.

wdenton commented 7 years ago

On another machine (R 3.4.2 on Ubuntu 17.10) it works properly, as one would expect. Must be something to do with that one machine. Strange!

wdenton commented 7 years ago

For the record, in case some far-future search turns up this bug, I think it happened because where I live we moved off Daylight Savings Time yesterday, so we set our clocks back an hour at 2 AM. Thus at "real" 2 AM it had been three hours since midnight.

github-actions[bot] commented 3 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.