Possible Duplicate:
Python datetime object show wrong timezone offset
I have a problem with conversion between timezones in Python, using the pytz
library (last version 2012h). Here in Brussels we have normally UTC+1 hour in winter and UTC+2 hours in summer.
I have the following code :
from datetime import datetime
import pytz
brussels_tz = pytz.timezone('Europe/Brussels')
utc_tz = pytz.utc
def main():
intermdate = datetime(2012, 07, 15, 8, 0, 0, 0, brussels_tz)
utcdate = intermdate.astimezone(utc_tz)
print "Brussels time is %s" % intermdate
print "UTC time is %s" % utcdate
if __name__ == '__main__':
main()
The problem is that I get the following result :
Brussels time is 2012-07-15 08:00:00+00:00
UTC time is 2012-07-15 08:00:00+00:00
So no difference. In my opinion the result should be (in summer):
Brussels time is 2012-07-15 08:00:00+02:00
UTC time is 2012-07-15 06:00:00+00:00
If I use the timezone Europe/Paris (normally the same time as in Brussels) I get even more strange results:
Paris time is 2012-07-15 08:00:00+00:09
UTC time is 2012-07-15 07:51:00+00:00
A 9 minutes difference !?!
Could anybody help me?