Time consts in Java?

前端 未结 13 644
遇见更好的自我
遇见更好的自我 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:24

    Here's what I use for getting milliseconds.

    import javax.management.timer.Timer;
    
    Timer.ONE_HOUR
    Timer.ONE_DAY
    Timer.ONE_MINUTE
    Timer.ONE_SECOND
    Timer.ONE_WEEK
    

提交回复
热议问题