【问题标题】:How to extract Date Only如何仅提取日期
【发布时间】:2013-09-12 20:34:02
【问题描述】:

使用时 test = new Date(),

在做console.log ('test')我明白了

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

【问题讨论】:

    标签: coffeescript meteor


    【解决方案1】:

    怎么样:

    test = new Date()
    
    console.log(test.toDateString())
    

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

    【讨论】:

      猜你喜欢
      • 2016-02-03
      • 2016-02-23
      • 2019-12-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-05
      • 2020-03-19
      • 2023-03-24
      相关资源
      最近更新 更多