[Python-Dev] Broken strptime in Python 2.3a1 & CVS
Kevin Jacobs
jacobs@penguin.theopalgroup.com
Wed, 8 Jan 2003 18:28:22 -0500 (EST)
Hi all,
I've just noticed a problem in one of our financial systems that was caused
by the new pure-Python strptime module by Brett Cannon. This was a test
system, so I suppose it was doing its job. SourceForge won't currently let
me login (big surprise there!) so I'm posting on python-dev for now.
Test script:
import time
n = time.strptime('7/1/2002', '%m/%d/%Y')
print 'Time tuple:',n
m = time.mktime(n)
print 'Seconds from epoch:',m
print 'Formatted local time:',time.strftime('%m/%d/%Y', time.localtime(m))
Python 2.2.2:
Time tuple: (2002, 7, 1, 0, 0, 0, 0, 182, 0)
Seconds from epoch: 1025499600.0
Formatted local time: 07/01/2002
Python 2.3-cvs (with #undef HAVE_STRPTIME hard-coded):
Time tuple: (2002, 7, 1, -1, -1, -1, 0, 182, -1)
Seconds from epoch: 1025492339.0
Formatted local time: 06/30/2002
Our financial system does _really_ strange things when dates don't
round-trip properly. It is running on a large IA32 Redhat Linux 8.0 system
with the latest Python CVS.
Thanks,
-Kevin
--
Kevin Jacobs
The OPAL Group - Enterprise Systems Architect
Voice: (216) 986-0710 x 19 E-mail: jacobs@theopalgroup.com
Fax: (216) 986-0714 WWW: http://www.theopalgroup.com