ahmed salah

ahmed salah

  • 1.2k
  • 547
  • 64.2k

How to get error input string not on correct format date time

Nov 9 2023 8:13 AM

I work on asp.net mvc application i get exception error on datetime different format from local pc to server but i don't know 

this error on which line so 

How to get full details about error and this error on which line of code specific 

i use try and catch for all function but it give me message 

input string not in correct format with datetime 

so which property or date time conversion give me error submittion date or joined date or last worked date 

    
   public JsonResult RequesterIndex(ResignationRequester resignationRequester)
   {
       dynamic responseData = new ExpandoObject();
       responseData.success = false;
       responseData.message = "";
try
{
int julianRequestDate = JulianDate.DateTimeToJulian(resignationRequester.LastWorkingDate);
 int SubmitionDate = JulianDate.DateTimeToJulian((DateTime)Session[SessionKeys.SubmitionDate]);
 int JoinedDate = JulianDate.DateTimeToJulian((DateTime)Session[SessionKeys.JoinDate]);
 int storedLastedWorkingDate = JulianDate.DateTimeToJulian((DateTime)Session[SessionKeys.LastWorkingDate]);
}
catch(Exception ex)
{
responseData.message=ex.Message;
}
return Json(responseData);
  }

 


Answers (2)