James Rich wrote:
> 
> On Wed, 31 Mar 2004, John King wrote:
> 
> >  At the time they need to validated, the dates have already been parsed into
> > 10A fields in a subfile program, I'm considering writing a procedure to make
> > a 'best-guess' as to the date's format - something akin to the code below.
> > Someone has to have addressed this situation before - would you care to give
> > out a few pointers?
> 
> This describes an API we wrote to do exactly what you are talking about:
> 

James, your API works on the assumption that the first non-failing guess
is the correct one.  Depending on what the dates mean, that could be
dangerous, and in the long run it's less user-friendly than asking the
user what format the dates are in.

I think a date-format guessing routine should check the date against all
date formats for the date's length, and declare it invalid unless it
matched exactly one format.

04/04/04 is coming up on Sunday.  (That's 04/04/04 for you *MDY folks.)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.