为什么Java程序员应该关心2038年的错误? [英] Why should a Java programmer care about year 2038 bug?
本文介绍了为什么Java程序员应该关心2038年的错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
2038年错误遍布网络,但这似乎是一个unix问题。这将如何影响java Date?
解决方案
什么让你觉得这样做? Java的日期
类存储一个64位 long
(不是32位,和Y2K38一样)。它也存储毫秒,这减少了范围,但只是稍微(相当于〜10位)。
在Java中,我们有292278994年的错误。
Year 2038 Bug is all over the web, But this seems to be a unix issue. How will this affect java Date ?
解决方案
What makes you think it does? Java's Date
class stores a 64-bit long
(not 32-bit, as with Y2K38). It also stores milliseconds, which decreases the range, but only slightly (equivalent of ~10 bits).
In Java, we have the year 292278994 bug.
这篇关于为什么Java程序员应该关心2038年的错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文