Difference in Days between two Java dates?

前端 未结 5 1510
南方客
南方客 2021-01-06 06:21

I want to get the difference between two Java Date objects. I\'ve used Joda-Time library. But the problem is that I\'m getting the Days greater difference than that of actua

5条回答
  •  不知归路
    2021-01-06 07:01

    Month is MM

    In your case:

    DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");

提交回复
热议问题