Javascript Date Plus One Day
Javascript Date Plus One Day
1
2
var start_date = new Date();
var afterOneDay = new Date(start_date.getTime() + 24 * 60 * 60 * 1000);
Date.now()
The Date.now() static method returns the number of milliseconds elapsed since the epoch, which is defined as the midnight at the beginning of January 1, 1970, UTC.
getTime()
The getTime() method returns the number of milliseconds since the epoch, which is defined as the midnight at the beginning of January 1, 1970, UTC.
This post is licensed under CC BY 4.0 by the author.