我需要将以下字符串转换为我尝试使用以下代码执行此操作的秒数:
String sDuration = "00:00:24.20";
SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss.SS");
videoLength = dateFormat.parse(sDuration);
Logger.debug("Duration: " + videoLength + " timestamp: " + videoLength.getTime());
但我得到的回应是:
Duration: Thu Jan 01 00:00:24 GMT 1970 timestamp: -3575980
第一个看起来不错,但我需要 .getTime() 进行计算,我得到一个负数?我预计会得到类似 24200 的东西。