New submission from Or Toledano <[email protected]>:
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 purpose it for the datetime, time classes.
I also added unit tests for the function in those classes.
GitHub PR:
----------
components: Library (Lib)
messages: 366696
nosy: Or Toledano, belopolsky, lemburg, p-ganssle
priority: normal
severity: normal
status: open
title: Add zero function to time, datetime, which acts as the use case of
replace to limit resolution
type: enhancement
versions: Python 3.9
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40316>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com