如何在angular6中使用typescript获取当年
currentYear:Date; this.currentYear=new Date("YYYY"); alert(this.currentYear);
它显示无效的日期
发布于 2018-08-29 13:11:22
试一下,
alert((new Date()).getFullYear());
https://stackoverflow.com/questions/52069833
相似问题