
var now = new Date();
var theYear = now.getYear();
if (theYear < 1000) theYear += 1900;

var D = ""+theYear+"";
document.write(D);