所以我正在尝试创建一个以这种格式显示日期的外部JavaScript文件;
[工作日],[月] [日期] [年]
我一直在网上看(w3schools),他们给了我一些非常好的帮助,但似乎没有给我一些我真正想知道的东西。
我尝试了一些不同的东西,但我似乎没有得到我想要的东西。
任何人都可以链接我一个网站/教程,或者一个给我这种格式的日期的实际文件吗?
(我对这一切都很陌生,所以我很遗憾:P)
到目前为止,这是我一直在使用的,但无法让它显示在我的页面中:(
var current_date = new Date ( );
var month_names = new Array ( );
month_names[month_names.length] = "January";
month_names[month_names.length] = "February";
month_names[month_names.length] = "March";
month_names[month_names.length] = "April";
month_names[month_names.length] = "May";
month_names[month_names.length] = "June";
month_names[month_names.length] = "July";
month_names[month_names.length] = "August";
month_names[month_names.length] = "September";
month_names[month_names.length] = "October";
month_names[month_names.length] = "November";
month_names[month_names.length] = "December";
var day_names = new Array ( );
day_names[day_names.length] = "Sunday";
day_names[day_names.length] = "Monday";
day_names[day_names.length] = "Tuesday";
day_names[day_names.length] = "Wednesday";
day_names[day_names.length] = "Thursday";
day_names[day_names.length] = "Friday";
day_names[day_names.length] = "Saturday";
document.write ( day_names[current_date.getDay()] );
document.write ( ", " );
document.write ( month_names[current_date.getMonth()] );
document.write ( " " + current_date.getDate() );
document.write ( " " );
document.write ( " " + current_date.getFullYear() );