i was trying to sum up some positive and negative durations made from character strings via hm() and noticed odd results. i assume this is not supposed to happen, or am i getting something wrong:
> library(lubridate)
Attaching package: ‘lubridate’
The following objects are masked from ‘package:base’:
date, intersect, setdiff, union
> x <- hm("-01:30")
> x
[1] "-1H 30M 0S"
> as.duration(x)
[1] "-1800s (~-30 minutes)"
> x <- hm("-02:30")
> x
[1] "-2H 30M 0S"
> as.duration(x)
[1] "-5400s (~-1.5 hours)"
i'm missing an hour here. this is not happening with positive periods:
> x <- hm("01:30")
> x
[1] "1H 30M 0S"
> as.duration(x)
[1] "5400s (~1.5 hours)"
i'm using lubridate version 1.9.3 with R version 4.4.3 on kubuntu 24.04.