如何将日期格式转换为毫秒?
如何从日期获取毫秒时间?我有以下代码。
Date beginupd = new Date(cursor1.getLong(1));
此变量 beginupd 包含以下格式
星期三 10月12 11:55:03 GMT+05:30 2011
现在如何将此格式转换为长数据类型中的毫秒时间?任何帮助都非常感谢,并提前感谢...
如何从日期获取毫秒时间?我有以下代码。
Date beginupd = new Date(cursor1.getLong(1));
此变量 beginupd 包含以下格式
星期三 10月12 11:55:03 GMT+05:30 2011
现在如何将此格式转换为长数据类型中的毫秒时间?任何帮助都非常感谢,并提前感谢...
long millisecond = beginupd.getTime();
返回自 1970 年 1 月 1 日 00:00:00 GMT 以来此 Date 对象表示的毫秒数。
您可以使用
Calendar cal = Calendar.getInstance();
cal.setTime(beginupd);
long millis = cal.getTimeInMillis();