Javascript Date (Year)
<pre><code>&lt;script language="JavaScript"&gt;
&lt;!-- Hide from older browser
var x= new Date()
var y= x.getYear()
var m= x.getMonth()+1  // added +1 because javascript counts month from 0
var d= x.getDate()
var h= x.getHours()
var mi= x.getMinutes()
var s= x.getSeconds()
document.write("Today's date is: ")
document.write(m+'/'+d+'/'+y+'  '+h+'.'+mi+'.'+s)
//--&gt;
&lt;/script&gt;
</code></pre>

<p>E.g Today date is  10 - 10  - 2011 ( d-m-Y) format
When i tested in 
Firefox 6.02  and Chrome 14 .0385  and opera 10.53 safari 5 : Today's date is: 10/10/111  18.1.6
On internet explorer ie8  :Today's date is: 10/10/2011  18.3.47
** i testing other thing..  but don't know why year getting wrong output  except internet explorer.Or other browser had different implementation getting year. ??
** print screen of the browser available if required..
link image <a href="http://imageshack.us/photo/my-images/502/javascriptdate.png/" rel="nofollow">http://imageshack.us/photo/my-images/502/javascriptdate.png/</a></p>
