日時処理

日時の処理

[1] 日時の処理は、簡単に見えて難しいものです。

表現

データモデルは日時データモデル

構文やデータ型は日時形式

演算

[8] 日時演算

[35] Common options | Elasticsearch Guide [8.11] | Elastic, , https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#date-math

問題

[6] 日時計算機システム等で処理する際には、 様々な問題に注意する必要があります。

[7] 日時処理の問題

[25] 日時というの複雑性に起因する問題もあれば、 日時を実装するためのモデル化の失敗による問題もあります。 日時制度の改正の実施・適用という社会システム運用の問題もあります。 日時とは無関係のプログラミングやシステム開発的な問題がたまたま日時処理に害を及ぼした場合もあります。

[26] 社会の情報化の進展に伴って、日時処理の失敗の影響範囲はますます拡大し、 それ自体が社会問題化するようになりました。

[27] 西暦2000年問題はその端緒であり、代表例といえます。 その後も日時処理の問題が起こるたびに、 西暦2000年問題の再来のような言われ方をしています。 西暦2020年問題, 西暦2021年問題, 西暦2038年問題, 令和改元, 暦年週年バグ


December was missing in the People app, not "completely nuked" or "lost in Android". It was the People app included with a specific version of Android, and only certain localizations (including English).

  • If you didn't bother upgrading your phone before December, the date/time on your phone would have gone to December just fine.
  • If you tried to set an appointment or schedule something to happen in December, it would work just fine.
  • If you set someone's birthday or anniversary or something via the web interface (google.com/contacts) It would sync and show them properly.
  • If you tried to set/change someone's birthday or anniversary via the People app on a 4.2.0 Android phone for the three weeks it was broken, and you were using an affected language, you'd have issues. The humanity.
[20] 「Android で12月がなくなる不具合があった」 のようなキャッチーだけど雑な情報を流している人に苦言を呈している。 そういうのが広がりがちで真相が見えづらくなるので、詳しい情報たすかる

[24] December month missing in calendar [36958380] - Visible to Public - Issue Tracker, https://issuetracker.google.com/issues/36958380#c46

[21] Android 4.2 bug omits December from the People app, makes end-of-year birthdays even less bearable | Engadget () https://www.engadget.com/2012-11-18-android-4-2-bug-omits-december-from-the-people-app.html

[23] Google cancels Christmas? Why Android can't remember December | Android | The Guardian, https://www.theguardian.com/technology/blog/2012/nov/18/android-december-lost-birthday

[22] クリスマス中止のお知らせ

[36] 年金問題、生年月日の日付を丸めて記録?? | スラド, https://srad.jp/story/07/10/26/0226214/

実装

[2] 日時処理の実装

関連

[4] 日次処理はまた違います。

メモ

[3] The Best Of Dates, The Worst Of Dates, Gilbert Healton, http://x109.healton.net/y2k/yrexamples.html

[5] [tz] Temporal - ECMAScript built-in JS Library for dates/times/timezones/calendars in progress (, ) https://mm.icann.org/pipermail/tz/2021-March/029899.html

[9] タイムゾーン呪いの書 (知識編), https://zenn.dev/dmikurube/articles/curse-of-timezones-common-ja

[10] COCOA v1.4.0 が起動しない · Issue #517 · cocoa-mhlw/cocoa · GitHub, https://github.com/cocoa-mhlw/cocoa/issues/517#issuecomment-978988403

DateTime()0001/01/01 0:00:00で、そこからさらに9時間を引こうとしているので怒られている。

DateTime.MinValueと同値であれば引かないようにとか考えたけど、DateTime.MinValueと同値ではない0001/01/01 0:08:00から9時間引こうとするとやっぱり落ちるよねと。

[11] DateTime.MinValue や new DateTime() は危険 - Cube Lilac (clown, ) https://clown.cube-soft.jp/entry/2021/11/26/datetime-trap

例えば、DateTime.MinValue.ToUniversalTime() は、予想に反して、例外を発生させずに正常終了します(日時の値は変更されずにタイムゾーンの値のみ UTC になる)。ただ、DataContractJsonSerializer の事例のようにライブラリ側で変換処理が実行されて例外が発生する事も多いため、万全を期すのであればライブラリに指定する全ての DateTime オブジェクトに対して ToUniversalTime 等を実施しなければならず、結構な負担となります。

[12] 606さんはTwitterを使っています 「Dropboxがおかしくて、毎回、関ヶ原終わりたてホヤホヤの頃のExcelファイルが出土されます 巻物でやれ https://t.co/hCLpKXDfde」 / Twitter (, ) https://twitter.com/bumWings/status/1483989654378405888

[13] 日付と時刻のデータ型および関数 - SQL Server (Transact-SQL) | Microsoft Docs, markingmyname, https://docs.microsoft.com/ja-jp/sql/t-sql/functions/date-and-time-data-types-and-functions-transact-sql?view=sql-server-ver15

[17] http://www.libraryjournal.com.cn/EN/article/downloadArticleFile.do?attachType=PDF&id=2289

[28] programming and calendar, , https://web.archive.org/web/20040203182933/http://www.funaba.org/en/programming-and-calendar.html

[29] Supported Presto and TD Functions - Product Documentation - Treasure Data Product Documentation, https://docs.treasuredata.com/display/public/PD/Supported+Presto+and+TD+Functions

[30] datetimeV2 作成済みエンティティ - LUIS - Azure Cognitive Services | Microsoft Learn, aahill, https://learn.microsoft.com/ja-jp/azure/cognitive-services/luis/luis-reference-prebuilt-datetimev2?tabs=1-1%2C2-1%2C3-1%2C4-1%2C5-1%2C6-1

[32] How to save datetimes for future events - (when UTC is not the right answer), , http://www.creativedeletion.com/2015/03/19/persisting_future_datetimes.html

[31] Storing UTC is not a silver bullet | Jon Skeet's coding blog, , https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bullet/

[33] JRS - Critical and Significant Dates - J R Stockton, , https://web.archive.org/web/20150908004245/http://www.merlyn.demon.co.uk/critdate.htm

[34] ruby/lib/time.rb at master · ruby/ruby · GitHub, https://github.com/ruby/ruby/blob/master/lib/time.rb