LoginSignup
1
0

DateTime.MaxValueの翻訳の誤り

Posted at

2023/7/31時点

DateTime.MaxValue フィールド (System)

Microsoftの公式の解説が、間違っているとはあまり思わないじゃないですか。
この項の日本語は機械翻訳みたいですが、日時の翻訳に失敗しているとは予想していませんでした。

この定数の値は、グレゴリオ暦の 9999 年 12 月 31 日の 23:59:59.99999999 と等価です。

とはっきり書いてあるので、

DateTime.Parse("9999-12-31 23:59:59.99999999")

がエラーになるのが、何故? としばらく原因を調査していました。

2時間ぐらい調べている中、英語の解説を読むと、

The value of this constant is equivalent to 23:59:59.9999999 UTC, December 31, 9999 in the Gregorian calendar

とあります。

99999999ではなくて、9999999です。
しかも、January 1, 10000が、100000 年 1 月 1 日になっています。

従って、エラーにならないコードは次です。

DateTime.Parse("9999-12-31 23:59:59.9999999");

スクリーンショット

英語

image.png

日本語

image.png

英語版では、
23:59:59.9999999
January 1, 10000

日本語版では、
23:59:59.99999999
100000 年 1 月 1 日

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0