[Tutor] Copy Files, Dates
Mike Hansen
mhansen@cso.atmel.com
Mon Apr 21 09:45:02 2003
Danny Yoo wrote:
>On Fri, 18 Apr 2003, Danny Yoo wrote:
>
>###
>
>
>>###
>>
>>
>>>>>isDate('April 18, 2003')
>>>>>
>>>>>
>><DateTime object for '2018-04-01 20:03:00.00' at 8125250>
>>
>>
>###
>
>Hmmm... actually, doesn't that look really weird to anyone else? *grin* I
>didn't notice it before, but the date that it parsed is totally not right.
>
>
>
>Instead of DateTimeFromString, I tried using DateFromString, with slightly
>better-but-still-weird values coming from the function. With the
>substitution to DateFromString, here's what happens now:
>
>###
>
>
>>>>isDate('04-18-2003')
>>>>
>>>>
><DateTime object for '2003-04-18 00:00:00.00' at 81b5670>
>
>
>>>>isDate('February 12, 2002')
>>>>
>>>>
><DateTime object for '2012-02-01 00:00:00.00' at 8125250>
>
>
>>>>isDate('Mumbember 12, 2002')
>>>>
>>>>
>0
>
>
>>>>isDate('1999/03/30')
>>>>
>>>>
>0
>
>
>>>>isDate('03/30/1999')
>>>>
>>>>
><DateTime object for '1999-03-30 00:00:00.00' at 8125250>
>###
>
>So there's something still wacky here... It might make an interesting
>project for someone to try improving mx.DateTime.parser.DateFromString to
>give better results.
>
Hmmm..I'll take a close look at mxDate before using it. I'll also
explore other solutions to my IsDate() function.
Thanks.
Mike