📜  java 将持续时间转换为长 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:43.891000             🧑  作者: Mango

代码示例1
Duration d = Duration.ofHours(1);     // 1 hour with java.time
long millis = d.toMillis();            // 1 hour in milliseconds