godkevin
05-25-2006, 06:30 PM
Im trying to get this date script to work but display the DAY at 7 days in the future. So if today is 05-01-06 I want the day to show 05-07-06. Here is the simple code im using.
<script type="text/javascript">
var mydate= new Date()
var theyear=mydate.getFullYear()
var themonth=mydate.getMonth()+1
var thetoday=mydate.getDate()
document.write("Today's date is: ")
document.write(theyear+"/"+themonth+"/"+thetoday)
</script>
I thought I could just change var thetoday=mydate.getDate() and just add +7 to make it var thetoday=mydate.getDate()+7
But for some reason like today is 05-25-06 and the script calculates the date as 05-32-06 when i add the 7 days. Is there a way to get this to automatically go to the next month?
<script type="text/javascript">
var mydate= new Date()
var theyear=mydate.getFullYear()
var themonth=mydate.getMonth()+1
var thetoday=mydate.getDate()
document.write("Today's date is: ")
document.write(theyear+"/"+themonth+"/"+thetoday)
</script>
I thought I could just change var thetoday=mydate.getDate() and just add +7 to make it var thetoday=mydate.getDate()+7
But for some reason like today is 05-25-06 and the script calculates the date as 05-32-06 when i add the 7 days. Is there a way to get this to automatically go to the next month?