Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
how convert 13-04-2023 to MMM Do YYYY in javascript?

I need to convert 13-04-2023 to MMM Do YYYY in javascript

moment(ResData.mDate).format("MMM Do YYYY")

I tried like above. But it gives output as Oct 14th 0018.how I fix this?

about 4 years ago · Santiago Gelvez
2 answers
Answer question

0

added the 'DD-MM-YYYY' part so moment correctly identifies the input format and parse the date

const day = '13-04-2023'
const x = moment(day,'DD-MM-YYYY').format("MMM Do YYYY")

console.log(x)
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js"></script>

about 4 years ago · Santiago Gelvez Report

0

This is working:

const o = moment("13-04-2023", "DD-MM-YYYY");
const s = o.format("MMM Do YYYY");
console.log(s); //=> Apr 13th 2023
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script>

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!