Hi,
There was a similar query before, in which the poster wanted to subtract 15
from the date. I didn't see a definitive answer.
Something to try/experiment with:
This javascript function returns the date
function getTheDate()
{
var now = new Date()
return now.toLocaleDateString()
}
In my case the local format is Tuesday, 29 March 2005.
However, there are functions which can extract the date and month from the
variable now.
The code to get month is something like this
monthList = new
Array('January','February','March','April','May','June','July','August','September','October','November','December')
month = monthList[now.getMonth()]
The code to get day is something like this
dayList = new
Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday')
day =dayList[now.getDate()]
This is the code for date
date= now.getDate()
This is the code for year
year = now.getFullYear()
So to add 6, try this
Add 6 to the date and then check whether it is more than the end date of the
month. If so subtract 31 (in this case) from the date and change the month
to April.
There may well be an easier way. I would be interested if there were, as it
could be made into a general function (unless one exists - others may know)
--
Cheers,
Trevor L.
Another FPB (FrontPage Beginner)
Website:
http://tandcl.homemail.com.au
I choose Polesoft Lockspam to fight spam, and you?
http://www.polesoft.com/refer.html