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

236
Views
Convert string(Date(1646764200000+0530)) to date in the format(dd-mm-yyyy) using javascript

I'm Trying to convert the below string to date in the format(dd-mm-yyyy)

let dob = /Date(1646764200000+0530)/

The above value of Date is given in string, How to convert it to date using JavaScript, Tried a lot of methods, but it shows an error as invalid date.?

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

0

Converting to the DD-MM-YYYY requires formatting.

Here is one way to extract the date portion using the slice() method then formatting the output to your desired format. This assumes that the input date is always in the same form and length.

let dob = /Date(1646764200000+0530)/;

let date = new Date(+(""+dob).slice(6,19)).toLocaleString('en-GB',{year:"numeric",day:"2-digit",month:"2-digit"}).split("/").join("-");

console.log(date)

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!