Hi,

I’m looking for a small help for forming the correct datetime format string for validating an user input.

Case 1:
User can enter 2008-11-08 or 11 nov 08 or 08 11 nov with spaces between dd mm and yyyy.If he enters any of these strings I should recognize it as a valid input and do an associated action.

Case 2:
Also there is another filed wherin he can enter nov 08,or 08 nov or 11 08 or 08 11 with or without spaces between them and I should recognize the month and the year.Please note that he wont enter the day, if he enters the day then I should take it as the first case and if he enters only month and year it should be the second case.

Also this should be culture independent as it can be used across globally.What I was planning to do was to parse the user input using datetime.tryparse and datetime .tryparseexact,but unfortunately I’m not able to form the exact expression.Can you please help me in this?

Thanks in advance,
mmx