Answers for "how to get current year in typescript"

2

angular current year

// In component file
export class SomeComponent {
  currentYear: number = new Date().getFullYear();
}

// In HTML file
<div> {{ currentYear }}. All rights reserved </div>
Posted by: Guest on November-27-2020
0

ts get year from date

new Date().getFullYear();
Posted by: Guest on April-30-2021

Code answers related to "how to get current year in typescript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language