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
rupesh asked 2 weeks 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!

Edit:

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;
                            alert(today)
1 Answers
Best Answer
Fernando answered 2 weeks ago
Your Answer

10 + 10 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com