title: How to convert a String to a Date - Invalid Date
body: <p>I have <code>moment</code> as a library within my project so answers with <code>moment</code> are fully welcomed.</p>
  
  <p>I have this date <strong>17th May 2017</strong>, I need to convert this into a valid date object. How can I achieve this?</p>
  
  <p>Both of the following returns <code>Invalid Date</code></p>
  
  <pre><code>moment('17th May 2017').format(...)
  new Date('17th May 2017')
  </code></pre>
  
  <p>What's odd is that I can use <code>moment</code> to format to <code>'Do MMMM YYYY'</code> which outputs the date like the above, however I am able to do it vice versa.</p>
  
  <p><strong>Update</strong></p>
  
  <p>Please see <a href="https://jsfiddle.net/c2tho3jy/" rel="nofollow noreferrer">this</a> JSFiddle where it is working.</p>
  
  <p>However, when I port it into my React app, it doesn't work as intended</p>
  
  <pre><code>const {
    safe_date: date,
  } = firstVideo;
  console.log(
    'MomentJS me!',
    date,
    moment(date, 'dd MMM yyyy'),
    moment(date, 'dd MMM yyyy').valueOf(),
  );
  </code></pre>
  
  <p><code>date</code> is a String</p>
  
  <p>The output of my <code>console.log</code></p>
  
  <pre><code>MomentJS me! 17th May 2017 ... NaN
  </code></pre>
  
  <p>I am not interested in the console.log of <code>moment(date.toString(), 'dd MMM yyyy')</code> so I have omitted it, the odd thing is the <code>valueOf()</code> is returning <code>NaN</code> but returns correctly on JSFiddle.</p>