How to add a day to a date in TypeScript [duplicate]

This is just regular JavaScript, no need for TypeScript.

yourDate = new Date(yourDate.getTime() + (1000 * 60 * 60 * 24));

1000 milliseconds in a second * 60 seconds in a minute * 60 minutes in an hour * 24 hours.

Additionally you could increment the date:

yourDate.setDate(yourDate.getDate() + 1);

The neat thing about setDate is that if your date is out-of-range for the month, it will still correctly update the date (January 32 -> February 1).

See more documentation on setDate on MDN.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)