如何日期格式转换成毫秒? [英] How to convert date format to milliseconds?
本文介绍了如何日期格式转换成毫秒?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从日期的毫秒时间?我有以下的code。
日期beginupd =新的日期(cursor1.getLong(1));
这个变量beginupd包含格式
周三10月12日11点55分03秒GMT + 05:30 2011
现在如何将此格式转换为long类型的毫秒时间? 任何帮助是非常提前AP preciated和感谢......
解决方案
长毫秒= beginupd.getTime();
返回的毫秒数自1970年1月1日00:00:00 GMT 再presented此Date对象。
How to get the millisecond time from date? I have the following code.
Date beginupd = new Date(cursor1.getLong(1));
This variable beginupd contains the format
Wed Oct 12 11:55:03 GMT+05:30 2011
Now how to convert this format to the millisecond time in Long datatype? Any help is highly appreciated and thanks in advance...
解决方案
long millisecond = beginupd.getTime();
Date.getTime()
JavaDoc states:
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.
这篇关于如何日期格式转换成毫秒?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文