Issue
How to get the current year using typescript in angular6
currentYear:Date;
this.currentYear=new Date("YYYY");
alert(this.currentYear);
It shows Invalid Date
Solution
Try,
alert((new Date()).getFullYear());
Answered By - Sajeetharan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.