我已经阅读了所有文档,似乎没有太多可以真正解释日期功能或缺少的内容。
我正在尝试实现 AlarmManger,它需要以毫秒 (ms) 为单位的触发时间。为了测试,我用了当前时间并增加了 5 秒,这很好。
// get a Calendar object with current time
Calendar cal = Calendar.getInstance();
// add 5 minutes to the calendar object
cal.add(Calendar.SECOND, 5);
如果我有日期和时间,我将如何获得那个时间的毫秒。
喜欢“2011 年 3 月 2 日 08:15:00”
我如何把它变成毫秒?