I don't know much about Javascript, and the other questions I found are related to operations on dates, not only getting the information as I need it.
Objective
I wish to get the date as below-formatted:
Printed on Thursday, 27 January 2011 at 17:42:21
So far, I got the following:
var now = new Date();
var h = now.getHours();
var m = now.getMinutes();
var s = now.getSeconds();
h = checkTime(h);
m = checkTime(m);
s = checkTime(s);
var prnDt = "Printed on Thursday, " + now.getDate() + " January " + now.getFullYear() + " at " + h + ":" + m + ":" s;
I now need to know how to get the day of week and the month of year (their names).
Is there a simple way to make it, or shall I consider using arrays where I would simply index to the right value using now.getMonth()
and now.getDay()
?
Date
object. I'll update in a minute. – Stirps