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

158
Views
How do I add one day or 12 hours to date in format of Thu Mar 03 2022 12:00:00 GMT in JavaScript

I want to add one day or 12 hours to a date in the format of

Thu Mar 03 2022 12:00:00 GMT

I have tried:

new Date(value.startDate + 1);

but it does nothing.

Please help me out, I am new to JavaScript.

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

0

Try this

const date = new Date("Thu Mar 03 2022 12:00:00 GMT");

date.setDate(date.getDate() + 1);
about 4 years ago · Juan Pablo Isaza Report

0

If you want to add something to your timestamp, this will do the trick no matter what you want to add.

const timestamp = new Date("Thu Mar 03 2022 12:00:00 GMT")
console.log(timestamp.toString())

// because getTime and setTime uses milliseconds:
const millisecondsToBeAdded = 12 * 60 * 60 * 1000
timestamp.setTime(timestamp.getTime() + millisecondsToBeAdded)

console.log(timestamp.toString())

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!