How to get current Year in Javascript?

 Posted by vishalneeraj-24503 on 12/19/2013 | Category: JavaScript Interview questions | Views: 1082 | Points: 40
Answer:

With the help of getFullYear() function of Date() Object ,we can get current Year.

function get_current_year() 

{
var date = new Date();
alert(date.getFullYear());
}


It will show current year as 2013.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response