Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用ummalqura-calendar在我的 Android 应用程序中显示回历日期
我从后端服务获取日期为 UNIXTIMESTAMP,我如何在库中使用这种格式
如果你有一个 unix 时间戳(自纪元以来的秒数),你应该能够将时间戳乘以 1000 以获得毫秒并使用setTime;
setTime
Calendar uCal = new UmmalquraCalendar(); uCal.setTime(new Date(myTimestamp * 1000));
如果您已经有了以毫秒为单位的时间戳,只需省略乘法即可。