Need help with a dating formula please

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tondalynn88
    New Member
    • Aug 2008
    • 1

    Need help with a dating formula please

    I am trying to write something that will take todays current date and add 56 days to it and display that end date THEN rest itself the next day, and the day after that, etc.

    I.E.
    Today would look look like this (8-21-2008) but would show 10-16-2008
    Tomorrow would be (8-22-2008) but would show 10-17-2008
    and it would continue to update day after day.

    Is this possible?? If I am in the wrong forum, could you please let me know where I shouls post this.

    Thanks!!
  • mrhoo
    Contributor
    • Jun 2006
    • 428

    #2
    Code:
    function getTodayPlus56(){
    	var d=new Date(); // today
    	d.setDate(d.getDate()+56); // add 56 days and
    	// format return string:
    	return [d.getMonth()+1,d.getDate(),d.getFullYear()].join('-'); 
    }
    alert(getTodayP lus56())

    Comment

    Working...