Azam.net
07-02-2005, 12:08 AM
How can I display the last year please? i.e. 2004 when the year is 2005 or 2006 when the year is 2007?
Had no luck finding a code in Google.
Thank you.
Had no luck finding a code in Google.
Thank you.
|
||||
Show last year please?Azam.net 07-02-2005, 12:08 AM How can I display the last year please? i.e. 2004 when the year is 2005 or 2006 when the year is 2007? Had no luck finding a code in Google. Thank you. Willy Duitt 07-02-2005, 12:15 AM Try: getFullYear()-1 jshl_wiz 07-02-2005, 01:03 AM something like: function getLastYear(){ var today = new Date(); var lastYear = today.getFullYear() -1; return lastYear; } You can change the "return" for a "document.write" or "alert()" or whatever code you want :o Azam.net 07-02-2005, 07:15 PM Thank you very much :) |
| |||
EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum