java - How to add 30 days (month) to given date? -
this question has answer here:
- how add 1 month current date in java? 12 answers
i use calenderutil this.i tried few times code.but didn't work.starting date given date chooser , after addition of 30 days need set ending date other date chooser.but doesn't work , please mention event need prefer. ex: mouseclicked event
import com.google.gwt.user.datepicker.client.calendarutil; import java.text.dateformat; import java.util.date; date d; d = startingdatebox.getdate(); calendarutil.addmonthstodate(d, 1); endingdatebox.setdate(d);
well try this.
calendar cal = calendar.getinstance(); cal.add(calendar.month, 1);
Comments
Post a Comment