How to parse given date string using moment.js?
<p>I want the following date string to be formatted using moment.js but it gives invalid date.</p>
<pre><code>var dateString = '2/17/2016 12:16PM GMT-05:00';
var pattern = 'MM/DD/YYYY h:mma ZZ';
var testDate = moment(dateString).format(pattern); //Invalid Date
</code></pre>
<p>How to parse it correctly or is there any other way to do so?</p>