I getting a Date value from JavaScript to a controller in MVC and I would like to parse it to .NET format DateTime but its giving me an error such as:
The string was not recognized as a valid DateTime.
The Format of the JavaScript date is:
"Wed May 23 2012 01:40:00 GMT+0200 (W. Europe Daylight Time)"
I've tried this but its not working:
DateTime.ParseExact(begin.Substring(1, 24), "ddd MMM d yyyy HH:mm:ss", CultureInfo.InvariantCulture);
anyone can give me a sample code please? thanks!