On Tuesday, November 09, 2010 12:49:19 pm Paul McNett wrote:
> On 11/9/10 7:32 AM, John Fabiani wrote:
> > I was wondering if it was intended that the getDateFromString() method
> > not accept a four digit year in a string?
> > 
> > daboDate.getDateFromString('06/19/66')
> > datetime.date(2066, 6, 19)
> > 
> > daboDate.getDateFromString('06/19/1966')
> 
> getDateFromString() by default only converts dates in 2 formats. It'll try
> them in this order:
> 
> ISO8601 ("YYYY-MM-DD")
> %x (the current locale's date format)
> 
> What's happening to you is that the current locale's format must be
> %m/%d/%y (MM/DD/YY) but you are passing the 4-digit year and python's
> time.strftime() function can't convert it.
> 
> Paul

I believe the dabo format is "%m/%d/%Y".  Unless it's being set somewhere 
else?  

So you are saying that somewhere the dabo format is " %m/%d/%y" and that's the 
root cause - right?

I fixed it by using the following:
datetime.datetime(*time.strptime(return_to_court_date, "%m/%d/%Y")[0:5])

But I was very surprised to see the dabo method fail.

Johnf

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to