hroptatyr / dateutils

nifty command line date and time utilities; fast date calculations and conversion in the shell
http://www.fresse.org/dateutils/
Other
618 stars 42 forks source link

Negative value when changing format string #116

Open konomikitten opened 4 years ago

konomikitten commented 4 years ago
$ dateutils.ddiff -f "%d day(s), %H hour(s) and %M minute(s)" "2020-11-10 07:00" now
0 day(s), 4 hour(s) and 21 minute(s)
$ dateutils.ddiff -f "%H hour(s) and %M minute(s)" "2020-11-10 07:00" now
-4 hour(s) and 21 minute(s)

I'm not sure where the negative is suddenly coming from can anyone help?

hroptatyr commented 4 years ago

Hiya, the negative sign is because your now previously (in terms of UTC) was earlier than 7 o'clock. The bug you're seeing has been addressed in a3d267fd4. It was because ddiff's printer is (was) unable to print -0.

konomikitten commented 4 years ago

Oh okay can I close the issue now since it's fixed?

hroptatyr commented 4 years ago

Well, fine by me. Problem is you'd either have to use the git version for now or wait for the release. You're not using ubuntu snaps by any chance?

konomikitten commented 4 years ago

Debian Unstable is what I use.