New submission from Or Toledano :
I propose the zero(time_unit) function, which replaces all time units with
greater equal resolution than time_unit by 0.
E.g.
>>> datetime.datetime(2020, 4, 18, 12, 27, 30, 500).zero("second")
datetime.datetime(2020, 4, 18, 12, 27)
I
Change by Or Toledano :
--
keywords: +patch
pull_requests: +18918
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19580
___
Python tracker
<https://bugs.python.org/issu
Or Toledano added the comment:
https://github.com/python/cpython/pull/19580
--
___
Python tracker
<https://bugs.python.org/issue40316>
___
___
Python-bugs-list m
Or Toledano added the comment:
The use-case for this method is to "limit" the resolution of a time object.
I encountered the need for it when I needed to reduce the resolution of some
timestamps, to compare them with timestamps of lesser resolution.
I found the following SOF po