Try to search your question here, if you can't find : Ask Any Question Now ?

Get last week date with jQuery/Javascript

HomeCategory: stackoverflowGet last week date with jQuery/Javascript
Avatarrupesh asked 3 months ago

I’m trying to get the last week date in javascript, without the time.

So for example, 10-02-2012, instead of 10-02-12 13:34:56 GMT.

Is there an easy solution out there for this?

Thank you!


I’m trying to make this dynamic, so that the resulting variable is always one week before the current date. Here’s what I’ve done to calculate the today variable, if this helps or can be used!

 var currentTime = new Date();
                            var month = currentTime.getMonth() + 1
                            var day = currentTime.getDate();
                            var year = currentTime.getFullYear();
                            var today = month + "-" + day + "-" + year;
1 Answers
Best Answer
AvatarFernando answered 3 months ago
Your Answer

8 + 11 =

Popular Tags

WP Facebook Auto Publish Powered By :