> * 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?
Not sure I understand this one. I though time.time() returned the seconds since Epoch?
>>> 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