Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative value when changing format string #116

Open
konomikitten opened this issue Nov 10, 2020 · 4 comments
Open

Negative value when changing format string #116

konomikitten opened this issue Nov 10, 2020 · 4 comments

Comments

@konomikitten
Copy link

$ 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 added a commit that referenced this issue Nov 10, 2020
* bug/116:
  fix, track negativity in precalc to allow -0, fixes issue #116
  test, provide regression test case
@hroptatyr
Copy link
Owner

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 a3d267f. It was because ddiff's printer is (was) unable to print -0.

@konomikitten
Copy link
Author

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

@hroptatyr
Copy link
Owner

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
Copy link
Author

Debian Unstable is what I use.

hroptatyr added a commit that referenced this issue Feb 2, 2021
* master: (45 commits)
  major, make ymcw dates ending in -00 synonymous with n-th ISO week in that month, use -07 for Sunday
  minor, properly convert negative stamps to hms
  minor, read epochs with strtoi64()
  minor, handle coordinated zones internally
  hygiene, use 48 bits for STAMP_MIN/STAMP_MAX
  minor, disallow transitions to the same type
  hygiene, operate with STAMP_MIN and STAMP_MAX for stamp_t slots
  debug, output test suite log in case of error
  fix, work around gcc antics
  minor, redo tzif reader, support files zic'd with -b slim
  use coordinated zone without leap transitions by default, fixes issue #121
  turn tzraw into standalone program for inspection
  docs: requested change, incomparable -> non-comparable
  docs: fix simple typo, uncomparable -> incomparable
  chore, make distcheck target non-parallel
  fix, track negativity in precalc to allow -0, fixes issue #116
  test, provide regression test case
  fix, also keep sandwich state when adding nanoseconds to dates, fixes #114
  fix, disallow business-day-of-year calendars, fixes issue #113
  hygiene, convince coverity that a certain path in __close() is impossible to walk into
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants