jon*_*rry 0 java
在创建日历时,是否有更轻量级的方法将Java中的时间戳缩短为一天?
如果没有,是否有标准的方法从时间戳创建一个Calendar实例而不调用System.currentTimeMillis(),因为Calendar.getInstance()涉及对System.currentTimeMillis()的调用?
Boz*_*zho 7
首先:在使用日期和时间时总是更喜欢joda- time.
至于日历 - 您只能通过调用getInstance()(或实例化GregorianCalendar,通常(但不总是))创建一个.然后,您可以设置时间戳calendar.setTimeInMillis(..)
getInstance()
GregorianCalendar
calendar.setTimeInMillis(..)
归档时间:
14 年,2 月 前
查看次数:
120 次
最近记录: