DateTime.Parse() function in the .net behaves depending on the system settings.
If the date format set in the system is dd/mm/yyyy and you try to parse the date which of "mm/dd/yyyy" format it will throw an error "String was not recognized as a valid date time".
To overcome this,
Regional and Language Settings --> Regional options-->
Customize-->Date-->Short date format.
change the format in this Short date format dropdown which solves the problem.
Wednesday, February 28, 2007
Subscribe to:
Post Comments (Atom)
1 comment:
There is one overload called IFormatProvider in the API. Did you check using that?
Post a Comment