3 ms·
> * 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() retur
by teh 15y ago
> * 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?
- nikcub 15y agoit 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