Java Milliseconds in Year

前端 未结 9 1928
终归单人心
终归单人心 2020-12-09 08:24

I am doing some date calculations in Java using milliseconds and noticing an issue with the following:

private static final int MILLIS_IN_SECOND = 1000;
             


        
9条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 09:03

    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
    

提交回复
热议问题