title: Change the date from local time to UTC with weird format
body: <p>I am trying to convert a time&amp;date string from the local time to UTC.
  Here is what I have :</p>
  <p>I use fullcalendar, and when the user clicks a date it will trigger a modal and in the modal, there is a field for the user to pick a date
  <a href="https://i.stack.imgur.com/7R0dV.png" rel="nofollow noreferrer">example</a></p>
  <p>For example, let's say that the user wants to use that date, now I need to convert it to UTC.</p>
  <pre><code>a =$('#Date').val();
  console.log(a);
  &quot;December 20, 2021&quot;
  </code></pre>
  <pre><code>b = $('#Time').val();
  console.log(b);
  &quot;12:30 AM&quot;
  </code></pre>
  <pre><code>c = a + &quot; &quot; + b;
  console.log(c);
  &quot;12:30 AMDecember 20, 2021&quot;
  </code></pre>
  <p>So I need the c variable converted to utc.</p>
  <p>Now what I am having trouble with is the format,</p>
  <pre><code>y = selectedDate = moment(c, 'h:mm DD/MM/YYYY');
  </code></pre>
  <p>Is not working
  And I am not 100% sure how to do this correctly.</p>
  <pre><code>console.log(y.utc());
  Object { _isAMomentObject: true, _i: &quot;December 20, 2021 12:30 AM&quot;, _f: &quot;h:mm DD/MM/YYYY&quot;, _isUTC: true, _pf: {…}, _locale: {…}, _d: Date Mon Dec 20 2021 20:30:00 (local time :D), _isValid: true, _ambigTime: false, _ambigZone: false, … }
  </code></pre>
  <p>Thank you!</p>