How to find the number of days between two dates in java or groovy?

后端 未结 9 1820
走了就别回头了
走了就别回头了 2020-12-09 19:25

I have a method which uses following logic to calculate difference between days.

long diff = milliseconds2 - milliseconds1;
long diffDays = diff / (24 * 60 *         


        
9条回答
  •  被撕碎了的回忆
    2020-12-09 20:11

    just parse 9th feb 2011 & 19th feb 2011 into dates using SimpleDateFormat and convert it to start & end millis and apply your calculation

提交回复
热议问题