1

使用时 test = new Date()

在做 console.log ('test')我得到

"Thu Sep 12 2013 17:55:25 GMT+0545 (NPT)". 我只需要服用"Thu Sep 12 2013"。做这些 (new Date()).getDay()对我不起作用。帮帮我,伙计们。提前谢谢你!!!

4

1 回答 1

2

怎么样:

test = new Date()

console.log(test.toDateString())

来自:http ://devdocs.io/javascript/global_objects/date/todatestring

于 2013-09-12T12:34:02.347 回答