I have a WPF window which contains a textbox in which the user can enter a date in any format that he desires and i have to parse it in a datetime variable, simple enough? I tried various formats, some of them work with datatime.parse some don't, so what should i do about such strings?
some e.g. formats (year is not mandatory):
- 21 Sept
- 21st Sept
- 21 September
- 21st September
- 21 Sep
- 21/09
- 21-09
whatever catches the users fancy as long as it is a proper readable date, can anyone help me with this?
Update : based on comments, i am modifying the input string format....what if user can enter in any way but always day followed by month followed by year(optional).....is that manageable ??