From: Olivier on
Hi
I have a user interface where user is prompted to enter a date in a format 'dd/mm/yy'.
I would like to check that if user has entered a valid date or not.
I thought of using datenum(dateinput,'dd/mm/yy') with a view that if a user inputs a wrong date then datenum will return an error.
It does not work. if dateinput = '01/13/10' (which is not a valid date) to my surprise I have got a result 734504 which is equivalent to '01/01/11'.
One way i could think of is extracting the numbers from the string and check.I would like to know if there is any simple of doing it.

Thank You in advance
Sumit
From: Olivier on
"Olivier " <sumit.iitkgp(a)gmail.com> wrote in message <hq6c12$n8t$1(a)fred.mathworks.com>...
> Hi
> I have a user interface where user is prompted to enter a date in a format 'dd/mm/yy'.
> I would like to check that if user has entered a valid date or not.
> I thought of using datenum(dateinput,'dd/mm/yy') with a view that if a user inputs a wrong date then datenum will return an error.
> It does not work. if dateinput = '01/13/10' (which is not a valid date) to my surprise I have got a result 734504 which is equivalent to '01/01/11'.
> One way i could think of is extracting the numbers from the string and check.I would like to know if there is any simple of doing it.
>
> Thank You in advance
> Sumit

Any Idea ??
No one