DateTime dateTime = new DateTime("2020-01-15");
DateTime dateTime1 = new DateTime("2019-08-05");
int days = Days.daysBetween(dateTime1, dateTime).getDays();
具体点开class查看更多方法 ---pom joda-time
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.9</version>
</dependency>
如果继承springboot父项目,则依赖时不用指定dependency里的version交给springboot来管理
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version&g
本文介绍了如何在Java中利用Joda-Time库进行日期操作,包括创建DateTime对象、转换为Date、修改时间、字符串格式化以及计算两个日期之间的天数和分钟差。示例代码详细展示了各种方法的用法。
订阅专栏 解锁全文
1294

被折叠的 条评论
为什么被折叠?



