如果可能的话,在没有 JavaScript 库或者大量繁琐代码的情况下,我正在寻找一种最简单的方法,将两周后的日期格式化为以下格式:
13th March 2013
我使用的代码是:
var newdate = new Date(+new Date + 12096e5);
document.body.innerHTML = newdate;
返回两周后的日期和时间,但是像这样: Wed Mar 27201321:50:29 GMT + 0000(GMT Standard Time)2013年3月27日星期三21:50:29 GMT + 0000(GMT 标准时间)
这是 JsFiddle中的代码。
如果你能帮忙,我会很感激的!