----- Original Message -----From: Philippe VignauxTo: zope@zope.orgSent: November 24, 2003 9:37 AMSubject: [Zope] date formatsHi all !
… can’t get rid off my dates problems ….
I would like the following python statements to apply validity checks on a date always inputed under format YYYY / MM / DD
(GMT+1)
The 2 first examples behaves as expected.
The last one not.
try:
date=DateTime('2003/07/03')
print date.strftime("%Y %B %d")
except:
print 'error'
return printed 2003 July 03 (OK)
try:
date=DateTime('2003/03/07')
print date.strftime("%Y %B %d")
except:
print 'error'
return printed 2003 March 07 (OK)
try:
date=DateTime('2003/13/03')
print date.strftime("%Y %B %d")
except:
print 'error'
return printed 2003 March 13 (NOK)
While I’m expecting an error (no months with id 13 !!!) it reverses the month part and the day part !!
Why ??
Is that the normal behaviour ??
Or is there any parameter to provide so that python knows the format is always YYYY / MM / DD
(the setup: Windows 2000 server Zope 2.6.2 python 2.1 )
Thanks for any help !
Phil.
_______________________________________________
Zope maillist - Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )