javascript get system data code example
Example 1: return current date in javascript
let today = new Date().toLocaleDateString()
console.log(today)
Example 2: get today's date javascript
var today = new Date();
Example 3: display date in javascript
<button onclick="displayDate()">The time is?</button>
<script>
function displayDate() {
document.getElementById("demo").innerHTML = Date();
}
</script>