Java中,怎么将当前时间的milliSeconds转换为hour级别的milliSeconds?
场景:
得到一个时间戳A:1473406568
对应的日期是B:2016/9/9 15:36:8
现在需要的是时间戳C:2016/9/9 15:00:00 对应的毫秒。
现在有大量的毫秒A数据,需要直接转为C中值,请问应该怎么处理?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
那玩意叫时间戳
若只取毫秒,可以使用 Calendar
本小时的毫秒 = 时间戳 % 3600000
小时时间戳 = 时间戳 - 本小时的毫秒
注意时区问题