c# - Parsing datetime in textbox -


i have datetime in 1 simple textbox. format of textbox's value can dd/mm/yyyy or mm/dd/yyyy. want parse using datetime.parse(string). dates works , others throws exception. how handle this? how make sure no matter format provided parses correct (as long valid date)?

thanks in advance :)

edit

as there no fix answer modify question ask how convert mm/dd/yyyy? should provide in iformatprovider of datetime.parse?

datetime needs know how parse date otherwise won't know whether 05/07/2011 5th july or 7th may. wouldn't better use calendar control remove ambiguity?


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -