dateutils icon indicating copy to clipboard operation
dateutils copied to clipboard

Negative value when changing format string

Open konomikitten opened this issue 4 years ago • 4 comments

$ 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?

konomikitten avatar Nov 10 '20 02:11 konomikitten

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.

hroptatyr avatar Nov 10 '20 09:11 hroptatyr

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

konomikitten avatar Nov 10 '20 09:11 konomikitten

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?

hroptatyr avatar Nov 10 '20 09:11 hroptatyr

Debian Unstable is what I use.

konomikitten avatar Nov 10 '20 09:11 konomikitten