Hi 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.