-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Closed as not planned
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Extend the datetime.date class with a new method timestamp() that mimic the same behavior of datetime.datetime.timestamp, where the time is implicitly "00:00".
Pitch
At the moment both datetime.datetime and datetime.date offers the fromtimestamp() classmethod to convert from float.
datetime.datetime objects, moreover, offer the timestamp() method to convert to float.
A similar method lacks for datetime.date.
Apart from the (lack of) symmetry, there are also some use cases where it's necessary to switch back-and-forth between datetime.dates and floats and it would be handy to have some predefined function already.
Previous discussion
https://discuss.python.org/t/a-timestamp-method-for-date-objects/13340
Linked PRs
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Projects
Status
Done