0

This is probably a silly question but I'm going to ask anyway because I haven't seen it yet on stack overflow. Is there a way to get tomorrow's date as a time object?

For instance, I can get today's date with new Date but what if I want to get tomorrow's date in the same format?

  • 1
    Does this answer your question? [How to add days to Date?](https://stackoverflow.com/questions/563406/how-to-add-days-to-date) – Sysix Mar 27 '23 at 22:02
  • @Sysix somewhat but there's not really a selected answer I just figured it out, however. – boredProjects Mar 27 '23 at 22:07

1 Answers1

0

I found the answer

const today = new Date()
// to return the date number(1-31) for the specified date
console.log("today => ",today)
let tomorrow =  new Date()
tomorrow.setDate(today.getDate() + 1)
//returns the tomorrow date
console.log("tomorrow => ",tomorrow)

Source

General Grievance
  • 4,555
  • 31
  • 31
  • 45