0
Reply

String was not recognized as valid date time - error

Komanduri Vishnu Teja

Komanduri Vishnu Teja

Mar 15 2006 7:00 AM
1.7k
Hi,

I am currently working on a asp.net application (version 1.1). In one page i am getting the system date by using the following function DateTime.Now.ToShortDateString(). This is returning the short date format. The short date format  of the system is "MM/DD/YYYY".
But some times i am facing a really wierd error, instead of giving me a date as "03/15/2006", this function is returning me "15-03-06". and when i click on the calender control is the date is getting displayed as March 03 1907.
This is not repeating all times.
Please help me in solving this error.
Thanks in Advance.