var time=new Date();
var year=time.getYear();

if (year < 2000)    // Y2K Fix
year = year + 1900; 

document.write(year);