News for hackers. Stuff that matters.
Re:Dealing with Timezones in Python by teh on Friday July 15, 2011 @09:39AM (#2767302)
> * never use time.time() to get a timestamp back because it will munge the value and re-add tz info

Not sure I understand this one. I though time.time() returned the seconds since Epoch?

Re:Dealing with Timezones in Python by nikcub on Friday July 15, 2011 @09:48AM (#2767334)
it does, but it assumes that the timestamp you are giving it is from your current timezone. compare:

    >>> time.mktime(datetime.datetime.now().utctimetuple())
    1310737652.0
    >>> int(datetime.datetime.utcnow().strftime('%s'))
    1310701659
my local timezone is +10, and mktime is adding it back in, hence why I always use strftime