Java 8中现已包含持续时间解析为纳秒再转换成毫秒
PeriodFormatter formatter = new PeriodFormatterBuilder()
.appendDays().appendSuffix("d ")
.appendHours().appendSuffix("h ")
.appendMinutes().appendSuffix("min")
.toFormatter();
Period p = formatter.parsePeriod("2d 5h 30min");
Duration d = Duration.parse(p.toString());
long milliseconds = d.toMillis();
System.out.println(d);
System.out.println(milliseconds);