var dt = new Date(); document.write(dt);
If you called the function like so today:
you would see 2007-2008.
You can see a working example of this on our demo page.
If you found this post helpful, please consider visiting one or more of the advertisers on the page. Writing good, in depth blog posts takes time, and advertising revenue - though by no means large - helps to offset the effort.