title: Initialise moment.js with UTC datetime value
body: <p>In my application, all datetimes are stored in the database in UTC. These dates are then converted to the correct timezone when the server-side code renders HTML.</p>
  
  <p>I am, however, having problems rendering UTC datetimes in client-side JavaScript using moment.js to convert them to the local timezone. </p>
  
  <p>In the example below, the UTC date stored in the database is 2017-10-10 16:53:10.127. I'm in the UK and daylight savings are still in effect, so I'd expect the datetime to be rendered as 10 Oct 2017 17:53:10 - an hour ahead of the UTC value.</p>
  
  <pre><code>function foo() {
      $.get({
          url: '/foo/583',
          cache: false,
          success: function(data) {
              console.log('Raw:        ' + data.UpdatedAtUtc);
  
              var utc = moment.utc(data.UpdatedAtUtc);
              console.log('Moment UTC: ' + utc.format('DD MMM YYYY HH:mm:ss'));
              console.log('Moment Local:' + utc.local().format('DD MMM YYYY HH:mm:ss'));
          }
      });
  }
  </code></pre>
  
  <p>The console output from this function is as follows:</p>
  
  <pre><code>Raw:          /Date(1507650790127)/
  Moment UTC:   10 Oct 2017 15:53:10
  Moment Local: 10 Oct 2017 16:53:10
  </code></pre>
  
  <p>Using <a href="https://www.freeformatter.com/epoch-timestamp-to-date-converter.html" rel="nofollow noreferrer">this online converter</a>, I've confirmed that the raw datetime value in the JSON represents my UTC value (10/10/2017, 4:53:10 PM UTC), so I'm happy that the MVC back-end is correctly converting the UTC value without messing with time zones.</p>
  
  <p>The value reported by the debugger on the client side is correct "/Date(1507650790127)/", and this is the value that I'm passing to the <strong>utc()</strong> method provided by moment.js with the understanding that it will interpret this as a UTC datetime value.</p>
  
  <p>The <a href="https://momentjs.com/guides/#/parsing/local-utc-zone/" rel="nofollow noreferrer">documentation</a> for the <strong>utc()</strong> method states that:</p>
  
  <blockquote>
    <p>If you wish to interact with the date as a UTC date, use moment.utc:</p>
    
    <blockquote>
      <p>moment.utc('2016-01-01T23:35:01');</p>
    </blockquote>
  </blockquote>
  
  <p>so I <em>presume</em> that I'm using it correctly. The output from my tests, however, indicate that the datetime value is being treated as a local time, since the formatted output from the <strong>utc()</strong> method has shaved an hour off of the time, writing it to the console as 15:53 instead of 16:53</p>
  
  <p>How do I initialise moment.js with the /Date()/ string correctly?</p>