469,344 Members | 6,209 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,344 developers. It's quick & easy.

One month Before Date

How Can i get the one month before Date from Current Date in Javascript. For Example,02/07/2012 is the Current Date. I need 01/07/2012
Feb 7 '12 #1
2 4312
8,652 Expert Mod 8TB
do you need just the month or the complete date?

anyways, you can change the month my using setMonth().
Feb 7 '12 #2
Hi there...

Expand|Select|Wrap|Line Numbers
  1. var myDate = new Date(document.getElementById("dateField").value);
  2. myDate.setMonth( myDate.getMonth() - 1 );
Feb 9 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Jim | last post: by
4 posts views Thread by Treetop | last post: by
2 posts views Thread by smcgrath via AccessMonster.com | last post: by
9 posts views Thread by ddtpmyra | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.