问题描述
我需要获取java / kotlin中ISO格式日期之间的分钟数示例:需要知道以下两个iso时间之间的分钟数
2019-02-18T06:37:00.000Z 2019-02-18T11:46:00.000Z
1楼
您可以使用和toMinutes()
方法:
ZonedDateTime dt1 = ZonedDateTime.parse("2019-02-18T06:37:00.000Z");
ZonedDateTime dt2 = ZonedDateTime.parse("2019-02-18T11:46:00.000Z");
System.out.println(Duration.between(dt1, dt2).toMinutes()); // 309