I have a dictionary which comes from a DB and I know that create_dt and install_ts match.
untimed = {'install_id': 399142, 'create_dt': datetime.datetime(2013, 7, 7, 0, 33, 2), 'install_ts': 1373157182}
And on QA when I run the following code everything is correct
>>(mktime(untimed['create_dt'].timetuple()) - untimed['install_ts']) / 3600
0.0
But when I run it locally on my laptop I get (Locally I'm in PST)
>>(mktime(untimed['create_dt'].timetuple()) - untimed['install_ts']) / 3600
7.0
Why am I not getting the same timestamp? I know that create_dt is in UTC, but locally it is forcing it to PST (-700).
Note: I've narrowed the issue down to this, but the full problem is I'm getting the wrong timestamp when I try
mktime(datetime.strptime(install['click_date'],'%Y-%m-%d %H:%M:%S').timetuple())
More specifically why in Convert python datetime to epoch with strftime does
>>> datetime.datetime(2012,04,01,0,0).strftime('%s') # This is equivalent to my issues above
'1333234800'
>>> (datetime.datetime(2012,04,01,0,0) - datetime.datetime(1970,1,1)).total_seconds()
1333238400.0
give different values?