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

166
Views
How to convert format date to dd/mm

Heloo, i want to convert format date 2022-04-09 08:00:33 to format 9 April. i was trying to convert it, but the format still wrong, thanks for help me before

#solved

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

When it comes to date manipulation in JavaScript, there are a lot of third-party libraries available. Some of the most popular options are Moment.js and Day.js. When it comes to formatting a date into a custom format, these libraries are really easy to use.

Example:

moment('2022-04-09 08:00:33','YYYY-MM-DD HH:mm:ss').format('D MMMM')

converts:

2022-04-09 08:00:33 to 9 April

You can visit the link to see available formats.

Or You can use a simple solution that involves native date class:

const date = new Date().toLocaleDateString('en-gb', {
    day: 'numeric',
    month: 'long',
  });
  console.log(date)

but for this input date should be in proper date format i.e., ISO String of timestamp in milliseconds.

The arrangement of day and month will be according to locale you use.

about 4 years ago · Juan Pablo Isaza Report

0

export const formatDate = (date) => {
  const newDate = new Date(date)
  const month = newDate.toLocaleString('default', { month: 'long' })
  const day = newDate.getDate()
  const formated = `${day} ${month}`
  return formated
}
about 4 years ago · Juan Pablo Isaza 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!