I want to get current time in a specific format with javascript.(我想用javascript获取特定格式的当前时间。)
With the function below and calling it will give me Fri Feb 01 2013 13:56:40 GMT+1300 (New Zealand Daylight Time) but I want to format it like Friday 2:00pm 1 Feb 2013(使用下面的函数并调用它,它将给我星期五Feb 01 2013 13:56:40 GMT + 1300(新西兰夏令时间),但我想将其格式化为2013年2月1日星期五2:00 pm)
var d = new Date();
var x = document.getElementById("time");
x.innerHTML = d;
Of course, code above doesn't have any formatting logic but I have not come across with any "working" formatters yet.(当然,上面的代码没有任何格式化逻辑,但是我还没有遇到任何“有效的”格式化程序。)
ask by Seong Lee translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…