public ActionResult SaveSelectedCustomers(string GetDateTime) { try { DateTime getDateTime = DateTime.ParseExact(GetDateTime, "yyyyMMdd HH:mm", CultureInfo.InvariantCulture); return Json(true); } catch( Exception ex) { throw ex; } }
An exception of type 'System.FormatException' occurred in oMail.Web.dll but was not handled in user code Additional information: String was not recognized as a valid DateTime.
DateTime getDateTime = DateTime.ParseExact(GetDateTime, "dd-MM-yy", CultureInfo.InvariantCulture);
Maciej Los wrote: Are you sure that string is in that format: "yyyyMMdd"? Shridhar Salunkhe wrote: dateFormat: "dd-mm-yy" in jquery
yyyyMMdd
Shridhar Salunkhe wrote: dateFormat: "dd-mm-yy" in jquery
dd-mm-yy
Mon May 22 2017 12:48:00 GMT+0530
DateTime.Parse
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)