views:

47

answers:

1

Hi,

I am getting the error: Conversion from string "11/07/2010 13:00:00" to type 'Date' is not valid. In my ASP.NET code when run on the web server. The date is valid and it can't be a US format issue because either way it would be valid. I have tested it and it seems to error when the time is > 12:00 (ie. a 24hour like 13:00 or 21:00).

I've googled and only found a sugeestion to bounce IIS on the server.

Any ideas why ???

thanks Dave

+1  A: 

Use the DateTime.TryParseExact() method.

Joel Coehoorn
Dave
BTW: THis works without any errors in development mode. It only fails when running the actual app on the test web server.
Dave