Hi,
basically I want to display todays date in reverse to form a invoice number
this code taken form w3schools will display the year
<script>
var d = new Date();
document.getElementById("demo").innerHTML = d.getFullYear();
</script>
but I need to add month and day without spaces with I believe
d.getDate()
and
d.getMonth()
how do I do this
cheers
var d = new Date().toISOString().slice(0,10);
d = d.replace(/-/g, '');
document.getElementById('demo').innerHTML = d;
Probably a million other ways too.