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

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -