【发布时间】:2021-12-14 17:01:11
【问题描述】:
我想知道日期,但我想返回前”Oct 29”。我试过使用拆分,但它每天都在变化。这是我到目前为止所拥有的。
Let date = Date().split(“ 2021”)[0];
这将返回day<string> month day<int>
【问题讨论】:
-
不存在它只是给出一个错误
Date().getMonth() is not a function -
这是一个方法Date.prototype.getMonth(),但你必须调用
new Date()而不是Date()
标签: javascript typescript