title: Parse and format date in string
body: <p>I'm trying out <a href="https://date-fns.org/" rel="noreferrer">date-fns</a> v2.</p>
  
  <p>I want to format a date in a string by using the <a href="https://date-fns.org/v2.0.0-alpha.8/docs/format" rel="noreferrer"><code>toDate</code></a> and <a href="https://date-fns.org/v2.0.0-alpha.8/docs/format" rel="noreferrer"><code>format</code></a> functions:</p>
  
  <pre><code>import { format, toDate } from 'date-fns'
  format(toDate('2019-02-11T14:00:00'), 'MM/dd/yyyy')
  </code></pre>
  
  <p>But get the following error:</p>
  
  <blockquote>
    <p>RangeError: Invalid time value</p>
  </blockquote>