title: Making AngularUI UI-Date datepicker use UTC time
body: <p>It seems the datepicker uses localized time but I need it to use UTC times when I make calls to the backend. I get around this issue by adjusting the value before posting it to the server using the following function:</p>
  
  <pre><code>function adjustDateForTimeOffset(dateToAdjust) {
      var offsetMs = dateToAdjust.getTimezoneOffset() * 60000;
      return new Date(dateToAdjust.getTime() - offsetMs);
  }
  </code></pre>
  
  <p>or simply by wrangling my date in a service. However, I also have some defaults that I want to use on load in my application and I need these dates to be in UTC and be displayed in the datepicker input box. However when I do this, the date is always a day before in the input box because ui-date uses local time.</p>
  
  <p>Is there a way to modify ui-date to run on UTC time all the time instead of local time?</p>
  
  <p>I've searched around the internet for an answer to this question but just keep finding ways to modify the date-ui but just keep finding ways to change the date before sending it to the server but that doesn't solve my problem. </p>