Date and time attributes

How can I set the current date automatically.

JavaScript using the date() function would be easiest

1 Like

great js function, yet it won’t let me set the current date on initial display… 0:((

add this to a js file

const today = document.getElementById("YOUR-ELEMENT-ID-HERE");
if(today) {
    let d = new Date();
    today.textContent = d.toLocaleDateString();
}
1 Like