你的赛博博客

探索数字未来的边界

java时间戳转换

1、时间戳(毫秒)

          System.currentTimeMillis()

2、时间戳(转秒)

         System.currentTimeMillis() / 1000

3、时间戳(转分钟)

        System.currentTimeMillis() / 1000 / 60

4、时间戳(转小时)

        System.currentTimeMillis() / 1000 / (60 * 60)

5、时间戳(转天)

       System.currentTimeMillis() / 1000 / (60 * 60 * 24)

posted @ 2023-03-25 14:13  Aoul  阅读(763)  评论(0)    收藏  举报