Home > Software design >  What is happening when i pass a date string as response to the Jquery Ajax Call from WebMethod
What is happening when i pass a date string as response to the Jquery Ajax Call from WebMethod

Time:02-28

I attempted to pass a date as a response from the webmethod via a jquery AJAX call. and the time is in GMT/UTC format oct 26 2021 12:01 am. However, the AJAX response contains /Date(1635264118393)/, which is irrelevant to the local timezone. The time zone of the local machine is ist. However, when I convert it, it is in a different timezone. Like oct 26 1:43 am gmt 0530(ist) but which is not correct ist time basted on utc..I'm curious about what happened between the webmethod and the Ajax response.

Thanks

CodePudding user response:

The asp. Net datetime object is different from javascript date object.. Refer this website which describes clearly.

https://www.dotnetodyssey.com/2015/01/17/sending-datetime-jquery-ajax-json-format-asp-net/

  • Related