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.
我看过这篇文章,它解释了如何获取自 1970 年以来当前日期的毫秒数:
如何获取日期值自 1970 年以来经过的秒数?
我的问题是:如何在任何日期以毫秒为单位获取此值?
谢谢 !!
日历 c = 新日历();
Calendar c = Calendar.getInstance(); // year, month, day, hourOfDay, minute c.set(1990, 7, 12, 9, 34); long millis = c.getTimeInMillis();