|Problems? Is your data what you think it is?|
Re: Numeric Date Validationby Not_a_Number (Prior)
|on Sep 30, 2003 at 19:04 UTC||Need Help??|
booter, forget it :-) Even treating the date as a string, you'd have problems.
Quite apart from trying to parse something like '310919':
1. Could it be ddmmyy? No (31 > days in Sept)
2. Could it be mmddyy? No (31 > months in year)
3. Could it be yyddmm? No (19 > months in year)
4. Could it be yymmdd? Yes! (1931:Sept:19)treating user input as a:
"numberic [which] cannot start with 0"
raises so many issues that IMO it would be better to rethink your 'pin number' concept.
How, for example, are you going to prompt for user input?:
How to explain that if the user's birthday is '030303', they have no choice but to enter '19030303' (if they're very old) or '20030303' (if they're very young)??
There must be a better way to do it!