mcmuney Posted April 23, 2010 Share Posted April 23, 2010 The year shows, "110" instead of "2010", what's wrong? <script language="JavaScript"><!-- var DayOfWeek = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); var MonthName = new Array('January','February','March','April','May','June','July','August','September', 'October','November','December'); var theDate = new Date(); document.write('<NOBR>' + DayOfWeek[theDate.getDay()] + ' ' + MonthName[theDate.getMonth()] + ' ' + theDate.getDate() + ', ' + (theDate.getYear() < 100 ? theDate.getYear() + 2000 : theDate.getYear()) + '</NOBR>'); //--></script> Link to comment https://forums.phpfreaks.com/topic/199442-what-wrong-with-this-script/ Share on other sites More sharing options...
andrewgauger Posted April 23, 2010 Share Posted April 23, 2010 Replace .getYear() with .getFullYear() .getYear() is depreciated. http://www.w3schools.com/jsref/jsref_obj_date.asp Link to comment https://forums.phpfreaks.com/topic/199442-what-wrong-with-this-script/#findComment-1046790 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.