2015-07-13 42 views

回答

1
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //change your formate accordingly 
sdf.setTimeZone(TimeZone.getTimeZone("UTC")); 

String inputString = "00:01:30.500"; 

Date date = sdf.parse("1970-01-01 " + inputString); 
System.out.println("in milliseconds: " + date.getTime()); 
+0

感謝回答我的問題:) 我做其工作原理是從0001年1970年加入毫秒到當前毫秒,然後做 –

相關問題