Interesting problem that has hit a great many of us over time. The question is - Is the data unique enough to eliminate "bad data".

valid formats per your post

yyyymmdd
yyyyddmm
yymmdd
yyddmm
ddmmyyyy
mmddyyyy
ddmmyy
mmddyy

date range Jan 01 1900 through Jan 01 2005 (assume this will be used for a while). What data can we eliminate as invalid.

take data in couplets.
if all columns are between 01 and 12 there is no identifying the data as month day or year (obviously a 6 digit date)
if a column contains between 32 and 99 or 00 it is the year - and if date is 8 digits long preceding 2 digits are century.
Having identified the year column, any other column containing 13-31 are days.

So having wandered about a bit, my conclusion IMHO is that this type of "edit" returns no value in a large percent of the time because while a format may be found as having violated none of the rules, we still have no idea what date was intended.

Valid and usable data are two different animals, just because the data passes all the tests we can think of, doesn't mean it is fit for the use we want to put it to.

Good luck!
dageek


In reply to Re: Numeric Date Validation by johndageek
in thread Numeric Date Validation by booter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.