Tutorialsplane

Vue.js get current year


We can use current date time object to get the current year. Here in this tutorial, we are going to explain how you can use can get current year in vue.js. You can also use our online editor to edit and run the code online.


Vue.js get current year Example

You can get current year in vue.js simply as below-

Example:

<div id="app">	
	<p>Current Year = {{currentYear}}</p>
	<button>Click Me</button>
</div>
       

Try it ยป

Output of above example-