Hi,
I'm trying to post a data that has UTC DateTime but when it's translated in WebAPI it's adds 1 day on it. I'm not sure what should be done
JavaScript
$.ajax({ url: 'http://localhost:41449/Promotion/Calculate', type: 'POST', dataType: 'json', data: { "PLAccountPromotionID": 158,"BusinessAreaID": 1,"AccountID": 28,"UserID": 81,"PromotionPLName": 'test me',"Description": 'test me', "StartDate": '2016-04-14T00:00:00.000Z',"EndDate": '2016-05-31T17:44:29.000Z', "ProcessID":3, }, xhrFields: { withCredentials: true }, success: function (result) { console.log(result); }, error: function (xhr, textStatus, errorThrown) { console.log('Error in Database'); } });
Web API Model
public DateTime EndDate { get; set; }
It seems that 2016-05-31T17:44:29.000Z is being converted to 2016-06-01 when it is passed to the model.
Not sure on how to solve this issue. Any help would be greatly appreciated.
Thanks.