K
KK
Hi,
I want my users to be able to enter date in any format. Such as
dd/mm/yyyy, mm/dd/yyyy etc...
then I use the following method to see wether this is
a valid date :
try
{
DateTime NewDate = DateTime.Parse("16/11/1976");
return true;
}
catch(FormatException ex)
{
return false;
}
but this always gives me a format exception. My computer
date format is in mm/dd/yyyy , but the date i am trying
to validate is in dd/mm/yyyy. Can't the parse method
recognize that this input date is in dd/mm/yyyy format?
rgds
KK
I want my users to be able to enter date in any format. Such as
dd/mm/yyyy, mm/dd/yyyy etc...
then I use the following method to see wether this is
a valid date :
try
{
DateTime NewDate = DateTime.Parse("16/11/1976");
return true;
}
catch(FormatException ex)
{
return false;
}
but this always gives me a format exception. My computer
date format is in mm/dd/yyyy , but the date i am trying
to validate is in dd/mm/yyyy. Can't the parse method
recognize that this input date is in dd/mm/yyyy format?
rgds
KK