hi, prior to 2.7.5, the strptime had a non standard fallback. If a format didn't match, it tried to guess format. This is not what standard lib from cpython does. If the string can not be converted using format, it fails.
In you case %m translates to zero padded month decimal, 01 for January Try %b instead. --pawel On Wed, Feb 8, 2017 at 11:02 AM, Djordje Spasic via Ironpython-users < ironpython-users@python.org> wrote: > Hello, > > I am using Rhino 5, and Rhino WIP <https://www.rhino3d.com/> applications > shipped with IronPython 2.7.0 and 2.7.5 version respectively. > > I have an issue with time.strptime > <https://ironpython-test.readthedocs.io/en/latest/library/time.html#time.strptime> > function. > The following code works perfectly on IronPython 2.7.0: > > *import *time > date = "JAN/30/2017" > date_timeStruct = time.*strptime*(date, "%m/%d/%Y") > > > Once IronPython 2.7.5 is installed, it fails with this error message on > the third line: > > Runtime error (ValueErrorException): time data does not match format > data=JAN/30/2017, fmt=%m/%d/%Y, to: M'/'d'/'yyyy > > > Is there a way of making the time.strptime function work on both 2.7.0 and > 2.7.5 versions? > > I would appreciate any kind of reply. > > Thank you in advance. > > _______________________________________________ > Ironpython-users mailing list > Ironpython-users@python.org > https://mail.python.org/mailman/listinfo/ironpython-users > >
_______________________________________________ Ironpython-users mailing list Ironpython-users@python.org https://mail.python.org/mailman/listinfo/ironpython-users