Using JavaScript Date Objects we can get the current year, month and date as well as manipulate those as well. But that's not the talking point in this post.
Get Year
The getFullYear() method returns the full year of any specified date.
So, we can create a date object first and then using that date we can get the year.
var d = new Date();
console.log(d.getFullYear());
// 2020
Get Month
The getMonth() method returns the month of a date as a number from 0 to 11.
So, similarly like year, we can create a date object first and then using that date we can get the month.
But, we need to add 1 to the number as we will get the month from 0 to 11.
var d = new Date();
console.log(d.getMonth()+1);
// 8
Get Date
The getDate() method returns the day of a date as a number between 1 to 31.
So, similarly like year and month, we can create a date object first and then using that date we can get the day.
var d = new Date();
console.log(d.getDate());
// 14
date functions getDate getFullYear getMonth month objects year