nominaldelta

nominal difference of date/datetime
git clone https://git.ce9e.org/nominaldelta.git

commit
469d63154e6633162b88889cb2f70eeae5ed15e7
parent
363d9a24147468444915fdc62357462d0ab01ce5
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2024-08-31 01:56
README: mention alternatives to diff()

Diffstat

M README.md 8 ++++++++

1 files changed, 8 insertions, 0 deletions


diff --git a/README.md b/README.md

@@ -85,5 +85,13 @@ many days can be added on top of the month. Last, the remaining difference in
   85    85 seconds is calculated. This approach is called "top heavy" because it
   86    86 prioritizes larger units over smaller ones.
   87    87 
   -1    88 If you prefer to get a difference in days or seconds, you can derive them from
   -1    89 the absolute differences:
   -1    90 
   -1    91 ```python
   -1    92 delta = NominalDelta(days=dt1.toordinal() - dt2.toordinal())
   -1    93 delta = NominalDelta(seconds=dt1.timestamp() - dt2.timestamp())
   -1    94 ```
   -1    95 
   88    96 [1]: https://docs.python.org/3/library/datetime.html
   89    97 [2]: https://github.com/dateutil/dateutil