Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Numeric Date Validation

by johndageek (Hermit)
on Oct 02, 2003 at 21:46 UTC ( #296104=note: print w/replies, xml ) Need Help??


in reply to Numeric Date Validation

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://296104]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2021-06-25 10:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (135 votes). Check out past polls.

    Notices?