Get the current date in JavaScript- JavaScript Date
objects represent a single moment in time in a platform-independent format. Date objects contain a Number that represents milliseconds since 1 January 1970 UTC. The Date()
constructor creates a new Date
object with the actual time value.
Code Get the current date in JavaScript-
let now = new Date();
console.log('The current date is: ' + now);