Node.js examples for Date:Year
Get Correct Year from Date
//----------------------------------------------------------------------------- // Date object extensions // ---------------------------------------------------------------------------- Date.prototype.getCorrectYear = function() { // Date.getYear() is unreliable -- // see http://www.quirksmode.org/js/introdate.html#year var y = this.getYear() % 100; return (y < 38) ? y + 2000 : y + 1900; }