string - Java, Calculate the number of days between two dates -
this question has answer here:
possible duplicate:
calculating difference between 2 java date instances
in java, want calculate number of days between 2 dates.
in database stored date
datatype, in code strings.
i want calculate no of days between 2 strings.
well start with, should only deal them strings when have to. of time should work them in data type describes data you're working with.
i recommend use joda time, better api date
/calendar
. sounds should use localdate
type in case. can use:
int days = days.daysbetween(date1, date2).getdays();
Comments
Post a Comment