Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

Issue on Posting UTC DateTime to Web API add up 1 day

$
0
0

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.


Viewing all articles
Browse latest Browse all 4850

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>