-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
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
Proposal:
It often happens that when working with datetime.time objects, user has to write custom constructions to get the number of seconds from the time object, like that:
>>> time_object = time(hour=5)
>>> total_seconds = time_object.hour * 3600 + time_object.minute * 60 + time_object.second
>>> print(total_seconds)
18000
It would be convenient to have a method that returns total number of seconds of time object
Example:
>>> time_object = time(hour=5)
>>> total_seconds = time_object.total_seconds()
>>> print(total_seconds)
18000
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
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