Join GitHub today
`duration` ignores class of first argument #462
In a nutshell, the following code
time = now() five_sec = interval(time, time + 5) duration(five_sec) #  "5s" duration(five_sec, units = 'days') #  "432000s (~5 days)"
Yields an unexpected output for the last line because the class of
The expected behaviour is that this should be disallowed — i.e. throw an error, or at least signal a stern warning that the interval’s unit is being ignored.
Thank you. Perhaps you can add a comment somewhere that for conversion you
I could not find it in the descrition nor in the article "Dates and Times
Hm. I am starting thinking this was a mistake. There might be plenty of derived classes from numeric that are valid inputs into
I am replacing this change with a much weaker check for "Period" and "Interval" class.