Hello everyone.
My first post... I'd like to add an automatically updating date field
to a webpage. I found the below example on the internet which works
brilliantly except I'd like an ordinal date (e.g. 1st, 2nd, 3rd, 4th)
instead of a cardinal date (e.g. 1, 2, 3, 4).
How could I do that with this small bit of javascript code?
<script language = "JavaScript ">
var now = new Date();
var monNames = new
Array("January" ,"February","Ma rch","April","M ay","June","Jul y","August","Se ptember","Octob er","November", "December") ;
document.write( "Last updated: " + now.getDate() + " " +
monNames[now.getMonth()] + " " + now.getFullYear ());
</script>
Thanks in advance for any advice and stuff.
My first post... I'd like to add an automatically updating date field
to a webpage. I found the below example on the internet which works
brilliantly except I'd like an ordinal date (e.g. 1st, 2nd, 3rd, 4th)
instead of a cardinal date (e.g. 1, 2, 3, 4).
How could I do that with this small bit of javascript code?
<script language = "JavaScript ">
var now = new Date();
var monNames = new
Array("January" ,"February","Ma rch","April","M ay","June","Jul y","August","Se ptember","Octob er","November", "December") ;
document.write( "Last updated: " + now.getDate() + " " +
monNames[now.getMonth()] + " " + now.getFullYear ());
</script>
Thanks in advance for any advice and stuff.
Comment