1

Each time that I choose a value from the datetimepicker and I send the info to the controller on the server side we are receiving a different time on the server side."caused by the UTC"

I would like to know how to apply the UTC time on the datepicker in order to avoid this error.

  <input type="text" id="datePickId" class="form-control" ng-model="dateFrom" datepicker-popup="{{'dd-MM-yyyy'}}" is-open="openedTo" close-text="Close" />

1 Answer 1

1

http://momentjs.com

You might want to use moment.js plugin for date handling on javascript, in the controller you simply do the follow:

var tmp = moment($scope.dateFrom).utc().format();

or

var tmp = moment.utc($scope.dateFrom, 'MM-DD-YYYY').format();

It returns the UTC time formatted, hope it helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.