This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christian.heimes
Recipients
Date 2007-02-21.14:55:01
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
I'm proposing some small enhancements to the datetime module:

Add a totimestamp() method to datetime.datetime that returns the seconds since 1/1/1970 00:00:00. The datetime class has already a fromtimestamp() factory but is missing a totimestamp() method.

Add a __int__() and __float__() method to datetime.timedelta which return the seconds (seconds + 86400 * days) as int and seconds + miliseconds as float. It would save some typing if somebody needs an integer representation of a timedelta object :]

The datetime module is implemented in C. I've never written a Python C extension so I can't help with a patch.

Thx
History
Date User Action Args
2007-08-23 15:56:38adminlinkissue1665292 messages
2007-08-23 15:56:38admincreate