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 belopolsky
Recipients aht, amaury.forgeotdarc, belopolsky, djc, hodgestar, mark.dickinson, pr0gg3d, zooko
Date 2010-06-06.01:15:07
SpamBayes Score 0.00023009809
Marked as misclassified No
Message-id <1275786911.49.0.0539493509912.issue6280@psf.upfronthosting.co.za>
In-reply-to
Content
With recent enhancements to datetime module, timegm has become a 1-liner:

EPOCH = 1970
_EPOCH_DATETIME = datetime.datetime(EPOCH, 1, 1)
_SECOND = datetime.timedelta(seconds=1)

def timegm(tuple):
    """Unrelated but handy function to calculate Unix timestamp from GMT."""
    return (datetime.datetime(*tuple[:6]) - _EPOCH_DATETIME) // _SECOND

I suggest committing modernized implementation to serve as a reference and encourage people to use datetime module and datetime objects instead of time module and time tuples.
History
Date User Action Args
2010-06-06 01:15:12belopolskysetrecipients: + belopolsky, zooko, amaury.forgeotdarc, mark.dickinson, djc, hodgestar, pr0gg3d, aht
2010-06-06 01:15:11belopolskysetmessageid: <1275786911.49.0.0539493509912.issue6280@psf.upfronthosting.co.za>
2010-06-06 01:15:09belopolskylinkissue6280 messages
2010-06-06 01:15:09belopolskycreate