Validate Date Format

liunx

Guest
Hi guys,

how can i validate the entered date format by the user in the date textbox? because the format should be (mm/dd/yyyy)..
what if the user enters the following format (dd/mm/yyyy) and clicks on submit.. is there a way to validate in the server side other than using the 'Regular Expression Validator"??

ASP.NET/VB.NET

Regards,
Ninasad thing is 01/05/2005 is a valid date in both instances.

you can look at using "new Date()"

EricYou can use IsDate(DateToValidate) to verify that the text can be converted into a date.

<!-- m --><a class="postlink" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctisdate.asp">http://msdn.microsoft.com/library/defau ... isdate.asp</a><!-- m -->

But alien is right, about the MM/dd/yyyy vs. dd/MM/yyyy problem.oh my god... what am i going to do now??? :(Hi,

Well, other pple reply ur question seem workable.

But then i felt i would make it simple enough to make the user to choose in ur format of mm/dd/yy, well, use a dropdown list of month, day, year, this way the user only have to follow ur format,isnt it?

my idea is simply urself, dont make ur life so difficult when u could find other easier ways. LOL
 
Back
Top