java - How to add 30 days (month) to given date? -


this question has answer here:

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

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -