title: how can I make this specific format with moment
body: <p>I need output like this:</p>
  
  <p>2017-08-11T16:11:00.000Z</p>
  
  <p>I am not sure what this format is called. It seems that there are atleast two variations of this kind of format, the one above and the one that looks like:</p>
  
  <p>2017-08-11 16:11:00+00:00</p>
  
  <p>Is it the same thing? Why two variations?</p>
  
  <p>Now to my problem, I am working with Vue2 and specifically I am using this component:</p>
  
  <p><a href="http://element.eleme.io/#/en-US/component/datetime-picker" rel="nofollow noreferrer">http://element.eleme.io/#/en-US/component/datetime-picker</a></p>
  
  <p>When it renders date to the user this component displays in this format: 
  2017-08-11 18:11:00 </p>
  
  <p>Behind the scene if I inspect the component value using Vue debugger it is stored like 2017-08-11T16:11:00.000Z</p>
  
  <p>If you notice on that value it is actually 2 hours offset, I guess that this vue component internally stores value in UTC time based on what user picked and users timezone?</p>
  
  <p>I got this reply from creator of this component when I asked him about what format value is stored inside component:</p>
  
  <blockquote>
    <p>The value of DateTimePicker is a Date object. You can format it to whatever form you like before sending it to the server.</p>
  </blockquote>
  
  <p>When I initialize this component I do it like this:</p>
  
  <pre><code>&lt;el-date-picker
      v-model="dateTimePicker"
      format="yyyy-MM-dd HH:mm"
      type="datetime"
      size='small'
      placeholder="Pick a date"&gt;
  &lt;/el-date-picker&gt;
  </code></pre>
  
  <p>dateTimePicker variable is initialized like this: </p>
  
  <pre><code>dateTimePicker: moment.utc(this.initPublishedAtDate, 'YYYY-MM-DD HH:mm').local().format('YYYY-MM-DD HH:mm')
  </code></pre>
  
  <p>dateTimePicker gets assigned date from server that is transformed to correct local time from UTC time stored on server.</p>
  
  <p>Now everything is fine, user sees correct time upon loading something he created before, but now if user tries to save whatever he is working on, client will send whatever is in dateTimePicker and currently on fresh page dateTimePicker will be in yyyy-MM-dd HH:mm format</p>
  
  <p>This is of course because user has not used picked any new time and datepicker component has not updated dateTimePicker variable with new correctly formatted value that my server expects.</p>
  
  <p>Now server will receive wrong time which is X hours offset and save incorrect time to db. Now if user refreshes the page the time will be wrong. Each time user saves to server without touching datepicker component, date will get offset each time and so on.</p>
  
  <blockquote>
    <p>Option 1:
    How can I send correct time to server if user has not messed with datepicker component and datepicker has not inserted correctly formated time?</p>
    
    <p>Option 2: 
    Could I perhaps initialize datepicker component with this format: 2017-08-11T16:11:00.000Z so that even if user does nothing with it and data is sent to server upon save, server will receive correct time.</p>
  </blockquote>
  
  <p>If I want to do it with second option, how do I produce that format when I initialize dateTimePicker  variable with date from server.</p>
  
  <p>Thanks for suggestions.</p>