As I am completely lost in the dozens of ways you find on stackoverflow to do timestamp conversions, so I will ask here the complete question:
Convert this timestamp from an apache log (in CEST timezone):
30/Aug/2015:05:13:53 +0200
Into this:
1440904433
Using
$ python --version
Python 2.6.6
Verification:
$ date --date @1440904433
Sun Aug 30 05:13:53 CEST 2015
$ date -u --date @1440904433
Sun Aug 30 03:13:53 UTC 2015
Bad results are:
1440911633
1440908033
My current code goes until here:
>>> from dateutil import parser
>>> parser.parse("30/Aug/2015:05:13:53 +0200".replace(':',' ',1))
datetime.datetime(2015, 8, 30, 5, 13, 53, tzinfo=tzoffset(None, 7200))
Please do not propose pytz module, I don't have it and I can't install it. Please do not propose solutions for python3