This content has been marked as final. Show 4 replies
use the getTime() method of your date object to convert to that date to ms (since 1970 or some such), subtract 7*24*60*60*1000 and then use that to create a new date object which you use to present the new date (now the old date less 7 days) formatted to your needs.
Thanks, guys, I actually figured it out but hadn't had time to post yet.
You are right. you just need to use the getTime() and convert it to whatever you're trying to add. In my case it was days so I had to divide by milliseconds, seconds, minutes, and then hours. That gave me how many days from the univeral date, Jan 1, 1970, I think. Then subtract the days I wanted to subtract. Finally convert back into milliseconds and use the setTime().
I couldn't find an easy tutorial or anything anywhere for this simple task.
Thanks for your help.