I am new with javascript, so maybe I missed the obvious.
I have the following script (see also some other answer):
<script>
var d = new Date();
document.getElementById("demo").innerHTML = d.toLocaleFormat("DD.MM.YYYY");
</script>
which I want to use to create a formatted date in jacasvript. If the date is today (26 June 2015) I expect this script to produce the following string:
26.06.2015
However, what I get is the following:
DD.MM.YYYY
Is the other answer wrong? How can I get this formatted date without some extra library?
I also tried to use parse
or format
instead without success.