I have a string like Mon 03-Jul-2017, 11:00 AM/PM, and I need to convert it to a type string 11:00 AM/PMusing js moment.
The problem is that I cannot get AMeither PMfrom the date time string.
I'm doing it:
moment(Mon 03-Jul-2017, 11:00 AM, 'dd-mm-yyyy hh:mm').format('hh:mm A')
and it works fine as I get 11:00 AM, but if the string has PMin it, it still gives AMin the output.
like this moment(Mon 03-Jul-2017, 11:00 PM, 'dd-mm-yyyy hh:mm').format('hh:mm A')also gives 11:00 AMin conclusion instead11:00 PM
source
share