title: javascript date getYear() returns different result between IE and Firefox, how to approach this?
body: <p>Apparently javascript date object's method getYear() returns different result between IE8 and Firefox3.6 (I have those 2 on my machine, not sure other browser or version)</p>
  
  <pre><code>Date d = new Date();
  alert(d.getYear());
  
  FF3.6 ==&gt; 111 (year since 1900? i guess)
  IE8 ===&gt; 2011
  </code></pre>
  
  <p>I have been only testing on Firefox and now my Javascript code that adjust returned value of getYear() is now giving me 3911 because of my coding.</p>
  
  <pre><code>var modified = d.getYear() + 1900
  </code></pre>
  
  <p>On Firefox it return 2011. But if I apply this approach on IE8, it return 3911.</p>
  
  <p>I could add logic to distinguish IE and Firefox but I don't want to add such if/else everywhere in my code wherever there are browser dependent parts like this. Is there other way to approach this problem?</p>
  
  <pre><code>var browserName=navigator.appName; 
  
  if (browserName=="Netscape") { 
     var modified = d.getYear() + 1900
  }
  else if(browserName=="Microsoft Internet Explorer") { 
     var modified = d.getYear();
  }
  </code></pre>