java - How to calculate difference in days between two dateboxes in GWT? -


this question has answer here:

i have 1 datebox (datebox1) in gwt application, allows users set date in past.

datebox1 set following format (not matters): datebox1.setformat(new datebox.defaultformat (datetimeformat.getformat("eee, mmm dd, yyyy")));

how programatically calculate difference in days between date selected in date box , current date.

i can't find on net , appreciate simple example.

the simplest way:

date currentdate = new date(); int daysbetween = calendarutil.getdaysbetween(mydatepicker.getvalue(), currentdate); 

Comments