The Date now() static method returns the number of milliseconds elapsed since the epoch, which is midnight at the beginning of January 1, 1970, UTC.
const now = Date.now();
console.log(now)
// 1706308102751
// below returns current date & time formatted
// const date = new Date();
// date.toString();