muek
muek

Reputation: 1080

AngularJS change date on http get request

I'm doing a HTTP get request, in my AngularJS controller, but I don't know why, my date in my Model is different from the date in the Query String generated:

$scope.modalSave = function() {
  console.log("modalSave:", $scope.modal);
  // prints the correct date: 2015-10-16 00:00

  $http.get('/Planner/Save', {
    params: {
      id: $scope.modal.Id,
      date: $scope.modal.Date //wrong date: 2015-10-15 23:00
    }
  });
}

Upvotes: 0

Views: 211

Answers (1)

user5454354
user5454354

Reputation: 26

Looks like a typical UTC date problem. The server on which the server is could have a different date set so it is returning a "wrong" values. I would double check the date on the service side.

Upvotes: 1

Related Questions