Time consts in Java?

前端 未结 13 633
遇见更好的自我
遇见更好的自我 2020-12-23 15:45

Is there a Java package with all the annoying time constants like milliseconds/seconds/minutes in a minute/hour/day/year? I\'d hate to duplicate something like that.

13条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-23 16:28

    If on android, I suggest:

    android.text.format.DateUtils

    DateUtils.SECOND_IN_MILLIS
    DateUtils.MINUTE_IN_MILLIS
    DateUtils.HOUR_IN_MILLIS
    DateUtils.DAY_IN_MILLIS
    DateUtils.WEEK_IN_MILLIS
    DateUtils.YEAR_IN_MILLIS
    

提交回复
热议问题