-4

I am trying to convert datetime "20190909070000+0000" value into mm/dd/yyyy hh:mm:ss pm by using moment.js.

Kindly assist me on this.

Ranjan Singh
  • 123
  • 2
  • 9

1 Answers1

0

const datetime = "20190909070000+0000";
const parsed = moment(datetime, "YYYYMMDDHHmmssZ").format('MM/DD/YYYY hh:mm:ss A');


console.log(parsed);
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js"></script>
protob
  • 3,317
  • 1
  • 8
  • 19