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

unwanted change in negative duration #149

Closed purple512 closed 1 year ago

purple512 commented 1 year ago

I upgraded from an older version and it broke my script.

v0.2.5

$ ddiff '01:20:00' '01:10:00' -f '%Hh %Mm'
0h -10m

v0.4.0

$ ddiff '01:20:00' '01:10:00' -f '%Hh %Mm'
0h 10m

This needs to be a negative duration. It's negative if I don't give a format specification. I understand that the reason is because it's trying to put the negative on the %H now instead of the %M and then it suppresses the negative zero. But that doesn't help me.

I just want a negative duration, the way it used to work. How can I get that?

hroptatyr commented 1 year ago

Hi, that was fixed in caf341f8e6adba3f45e11fe54176cf0be00b2744.

purple512 commented 1 year ago

Ah, thank you, that's good to hear. Unfortunately 0.4.0 is what Cygwin provides: https://cygwin.com/cgi-bin2/package-grep.cgi?grep=dateutils

I guess I could try building it myself. Would probably be easier to just write my script as a Python script.

purple512 commented 1 year ago

Okay, was able to build and install the current version into /usr/local so that it overrides the system one, so I'll close this as a Cygwin issue and not a dateutils problem.