I need to find some script which shows a post date of 5, 6, and 7 days (separately) of the current date. I currently have some but when it get to the end of the month, like today, it is showing the 33rd March.
@felgallMar 30.2007 — #<i> </i>function daysfromnow(num) { var calc = new Date(); calc.setDate(calc.getDate()+num); return calc.getMonth()+'/'+calc.getDate()+'/'+calc.getFullYear(); }
pass in the number of days from now that you want the date for and the above function will return the correct date for that day in MM/DD/CCYY format. Use negative numbers if you need past dates.