Hi Guy,
It's a bit weird it seems that when I want to get a timezone for Europe/Paris with pytz it gets me to the PMT timezone instead of GMT+1 when it seems to work for Europe/Berlin.
Not clear ? Well look at this snippet :
#!/usr/bin/python
import os
import datetime
from pytz.tzfile import build_tzinfo
base='/usr/share/zoneinfo/'
tz = build_tzinfo('Europe/Paris',
open(os.path.join(base,'Europe','Paris'), 'rb'))
fmt = '%Y-%m-%d %H:%M:%S %Z%z'
print datetime.datetime(2009, 01, 30, 9, 00, tzinfo=tz).strftime(fmt)
tz = build_tzinfo('Europe/Berlin',
open(os.path.join(base,'Europe','Berlin'), 'rb'))
print datetime.datetime(2009, 01, 30, 9, 00, tzinfo=tz).strftime(fmt)
the output is :
2009-01-30 09:00:00 PMT+0009
2009-01-30 09:00:00 CET+0100
when really paris should be as well CET+1.
Constructing from datetime.datetime.now(tz) would get the thing right no matter what.
Anybody have an idea ?