I hope this is what you want:

const today = new Date();
const yyyy = today.getFullYear();
let mm = today.getMonth() + 1; // Months start at 0!
let dd = today.getDate();

if (dd < 10) dd = '0' + dd;
if (mm < 10) mm = '0' + mm;

const formattedToday = dd + '/' + mm + '/' + yyyy;

document.getElementById('DATE').value = formattedToday;

How do I get the current date in JavaScript?

Answer from Aelios on Stack Overflow
🌐
freeCodeCamp
freecodecamp.org › news › javascript-date-now-how-to-get-the-current-date-in-javascript
JavaScript Date Now – How to Get the Current Date in JavaScript
June 15, 2020 - It returns the value in milliseconds that represents the time elapsed since the Epoch. You can pass in the milliseconds returned from the now() method into the Date constructor to instantiate a new Date object:
🌐
JavaScript.info
javascript.info › tutorial › the javascript language › data types
Date and time
Otherwise, if since date passed less than 1 minute, then "n sec. ago". Otherwise, if less than an hour, then "m min. ago". Otherwise, the full date in the format "DD.MM.YY HH:mm". That is: "day.month.year hours:minutes", all in 2-digit format, e.g.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-format-a-date-with-javascript-date-formatting-in-js
How to Format a Date with JavaScript – Date Formatting in JS
November 7, 2024 - Using Intl.DateTimeFormat, you can specify the desired locale and various options to format dates precisely as needed. There are more options you can use in the official documentation. When working with dates, it's essential to consider time zones, especially when dealing with global applications or time-sensitive information. JavaScript provides methods to handle time zones effectively:
🌐
Codedamn
codedamn.com › news › javascript
How To Get Current Date In JavaScript – Complete Guide
June 9, 2023 - In this example, we used the format string 'DD-MMMM-YYYY', which corresponds to a 2-digit day, a long month name, and a 4-digit year. To get the current time, you can use the following methods on a Date object:
🌐
InfluxData
influxdata.com › home › how to get, convert & format javascript date from timestamp | influxdata
How to Get, Convert & Format JavaScript Date From Timestamp | InfluxData
February 10, 2023 - The Date.now() method is a built-in function in JavaScript that allows developers to retrieve the current timestamp quickly.
🌐
Bugfender
bugfender.com › blog › javascript-date-and-time
The Definitive Guide to JavaScript Date and Time | Bugfender
February 18, 2025 - timeago.js: timeago.js is a lightweight(~2KBs) nano library used to format date and time with *** time ago statement (e.g.: ‘2 hours ago’). It has support for React, Python, and plain JavaScript. ... Are you also working with Swift? Improve your iOS development skills by reading our detailed guide on Date Manipulation in Swift, tailored for advanced developers. Mastering Swift Date Operations: A Comprehensive Guide for iOS Developers · You must have realized by now that the JavaScript Date object is vast.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-date-now-method
JavaScript Date now() Method - GeeksforGeeks
July 11, 2025 - JavaScript · // Use of Date.now() method let d = Date(Date.now()); // Converting the number of millisecond in date string a = d.toString() // Printing the current date console.log("The current date is: " + a) Output · The current date is: Sat Jul 13 2024 20:59:57 GMT+0000 (Coordinated Universal Time) The code snippet generates a new Date object using the current timestamp from Date.now(). It then converts this date object to a string format using .toString() and logs it, displaying the current date and time.
🌐
Codecademy
codecademy.com › article › javascript-date-format
How to Format a Date in JavaScript | Codecademy
To get a Date object for a specific date, we can pass the date as a string to the Date() constructor. ... You can pass the input date string to the Date() constructor in other formats as well, such as January 14, 2025 or 2025-01-14.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-format-javascript-date-as-yyyy-mm-dd
How To Format JavaScript Date as yyyy-mm-dd? - GeeksforGeeks
June 24, 2025 - We use JavaScript built-in help methods from the Date class that help us to create a formatted version of the current date in the form of yyyy-mm-dd.
🌐
LogRocket
blog.logrocket.com › home › how to format dates in javascript: methods, libraries, and best practices
How to format dates in JavaScript: Methods, libraries, and best practices - LogRocket Blog
May 8, 2025 - Here’s what you need to know: // Creating a new Date object const now = new Date(); // Current date and time const isoDate = new Date('2025-02-18T14:30:00.000Z'); // From date string const withComponents = new Date(2025, 1, 18); // Year, month ...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-get-current-formatted-date-dd-mm-yyyy-in-javascript
How to Get Current Formatted Date dd/mm/yyyy in JavaScript? - GeeksforGeeks
July 11, 2025 - '0' + month : month; return `${day}/${month}/${year}`; } const today = new Date(); console.log(getFormattedDate(today)); ... JavaScript is best known for web page development but it is also used in a variety of non-browser environments.
🌐
DEV Community
dev.to › sojinsamuel › one-line-of-code-to-format-dates-in-javascript-i-mean-it-567a
One Line of Code to Format Dates in JavaScript (I mean it) - DEV Community
June 15, 2022 - Let's look at two approaches for formatting dates in the best way possible so that you may utilize them for your projects. The toDateString() function in JavaScript returns the date component of a date object as a string in the following format:
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › now
Date.now() - JavaScript | MDN
// This example takes 2 seconds to run const start = Date.now(); console.log("starting timer..."); // Expected output: "starting timer..." setTimeout(() => { const ms = Date.now() - start; console.log(`seconds elapsed = ${Math.floor(ms / 1000)}`); // Expected output: "seconds elapsed = 2" }, 2000);
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date
Date - JavaScript | MDN
There are many ways to format a date as a string. The JavaScript specification only specifies one format to be universally supported: the date time string format, a simplification of the ISO 8601 calendar date extended format.
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Date › Date
Date() constructor - JavaScript | MDN
The returned date's timestamp is the same as the number returned by Date.now(). value · An integer value representing the timestamp (the number of milliseconds since midnight at the beginning of January 1, 1970, UTC — a.k.a. the epoch). dateString · A string value representing a date, parsed and interpreted using the same algorithm implemented by Date.parse(). See date time string format for caveats on using different formats.
🌐
date-fns
date-fns.org
date-fns - modern JavaScript date utility library
date-fns provides the most comprehensive yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js.
🌐
W3Schools
w3schools.com › js › js_dates.asp
JavaScript Dates
February 4, 2026 - JavaScript stores dates as number of milliseconds since January 01, 1970. Zero time is January 01, 1970 00:00:00 UTC. One day (24 hours) is 86 400 000 milliseconds. Now the time is: milliseconds past January 01, 1970
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Intl › DateTimeFormat › DateTimeFormat
Intl.DateTimeFormat() constructor - JavaScript | MDN
January 21, 2026 - When formatting Temporal.PlainDateTime and Temporal.Instant, year, month, day, hour, minute, and second default to "numeric". Implementations are required to support displaying at least the following subsets of date-time components: