How to get am pm from the date time string using moment js : <p>I have a string as <code>Mon 03-Jul-2017, 11:00 AM/PM</code> and I have to convert this into a string like <code>11:00 AM/PM</code> using moment js.</p>

<p>The problem here is that I am unable to get <code>AM</code> or <code>PM</code> from the date time string.</p>

<p>I am doing this:</p>

<pre><code>moment(Mon 03-Jul-2017, 11:00 AM, 'dd-mm-yyyy hh:mm').format('hh:mm A')
</code></pre>

<p>and it is working fine as I am getting <code>11:00 AM</code> but if the string has <code>PM</code> in it it is still giving <code>AM</code> in the output.</p>

<p>like this <code>moment(Mon 03-Jul-2017, 11:00 PM, 'dd-mm-yyyy hh:mm').format('hh:mm A')</code> is also giving <code>11:00 AM</code> in output instead of <code>11:00 PM</code></p>
