[Python Wpg] Python test for DST correctness

Sydney Weidman syd at plug.ca
Thu Mar 8 13:36:09 EST 2007


Hi all!

I thought I'd quickly try to whip something up in python that would test
to see if the correct DST rules are in place, but I couldn't seem to get
it to work properly. This test fails on platforms that have the correct
timezone files in place and on those that don't. Does anyone have a
suggestion for how to do this? I have included my tiny unittest that I
thought would do it, but I've obviously made some incorrect assumption
about how the Python datetime library works. I realize I could just do
os.system('date -d "15 March") and check the output for CDT instead of
CST, but I thought there would be a more Pythonic way to do it.

Regards,
Syd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testdst.py
Type: text/x-python
Size: 553 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/winnipeg/attachments/20070308/76b1ed67/attachment.py>


More information about the Winnipeg mailing list