📜  从日期获取长 java 代码示例

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

代码示例1
String string_date = "12-December-2012";

SimpleDateFormat f = new SimpleDateFormat("dd-MMM-yyyy");
try {
    Date d = f.parse(string_date);
    long milliseconds = d.getTime();
} catch (ParseException e) {
    e.printStackTrace();
}