2157 年 2 月 31 日这个日期有何意义?

发布于 2024-10-11 10:23:51 字数 318 浏览 3 评论 0原文

我在大型 IT 支持环境中工作。现在我们已经两次看到无效日期 02/31/2157 被插入到 Oracle DATE 列中。到目前为止,我还无法重现此问题,但当用户尝试将“00/00/0000”保存到列中时,它似乎偶尔会发生。我相信该值源自 PowerBuilder DataWindow 更新。

该应用程序使用无数的库来实现各种技术,因此这个问题可能有点模糊,但是...

有没有人在某些已建立的库中看到过日期 02/31/2157,当其他无效日期出现时,Oracle 可能会默认该日期进入?也许是类似于 1970 年 1 月 1 日的时间开始日期的时间结束概念?

I work in a large scale IT support environment. Twice now we have seen an invalid date of 02/31/2157 being inserted in an Oracle DATE column. So far I have not been able to reproduce this problem, but it appears to be happening occasionally when a user attempts to save '00/00/0000' into the column. I believe the value is originating from a PowerBuilder DataWindow update.

The application uses myriad libraries for all sorts of technologies, so this question may be a bit vague, but...

Has anyone seen the date 02/31/2157 in some established library that Oracle could be defaulting to when some other invalid date is entered? Perhaps an end-of-time concept analogous to the beginning-of-time date of 1/1/1970?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

-小熊_ 2024-10-18 10:23:51

来自 http://download.oracle.com/文档/cd/B19306_01/server.102/b14220/datatype.htm#i1847"

Oracle 使用自己的内部格式来
存储日期。日期数据存储在
七个字节的固定长度字段
每个,对应于世纪,年份,
月、日、时、分、秒。

2157-256 = 1901,这似乎可疑地接近可能的纪元 1/1/1900(或 12/13/1901 - 这是 2038 年问题

我猜测它在日期字节中存储 0x00 或 0xFF,然后在解码时感到困惑。 (它如何处理 255 月份?)

From http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#i1847"

Oracle uses its own internal format to
store dates. Date data is stored in
fixed-length fields of seven bytes
each, corresponding to century, year,
month, day, hour, minute, and second.

2157-256 = 1901, which seems suspiciously close to a possible epoch of 1/1/1900 (or 12/13/1901 - which is the rollover date for the Year 2038 Problem)

I'd guess that it is storing either 0x00 or 0xFF in the date bytes, then getting confused when it decodes it. (How does it deal with month 255?)

破晓 2024-10-18 10:23:51

事实证明这是一个 powerbuilder 问题。该字段在数据窗口中创建为必需,但在保存之前以编程方式更改为非必需。因此,空值被保存到非空数据库列中,并且 powerbuilder 插入了一些虚拟日期,而不是仅仅抛出错误。

Turns out this was a powerbuilder issue. The field was created in the datawindow as required, but was programmatically changed to be non-required before saving. So a null value was being saved to a non-null database column, and powerbuilder inserted some dummy date instead of just throwing an error.

苏大泽ㄣ 2024-10-18 10:23:51

我记得在保存无效日期时得到了一个奇怪的值。 IIRC 它是在 PB 9 中,我们必须为其获得 EBF。这是日期编辑掩码的问题,并且输入了未被拒绝的无效日期。抱歉我没有更多细节。

I remember getting a weird value when saving an invalid date. IIRC it was in PB 9 and we had to get an EBF for it. It was a problem with Date Editmasks and entering an invalid date that wasn't rejected. Sorry I don't have more details.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文