LONGDATETIME

LONGDATETIME

[15] 旧Mac0 とする単一数値時刻系を使っていました。 現在も旧Macに由来する各種システムが採用しています。

[20] 日時を単位とし、 日付を単位とします。

[21] 時間帯は明記した資料があまりありませんが、地方時と思われます。

[25] Approaching the Millennium: The Mac and the Year 2000, , https://web.archive.org/web/20141113171013/http://www.fenestrated.net/~macman/mirrors/Apple%20Technotes%20(As%20of%202002)/tn/tn1049.html

[1] Excel の 1900 年を基準とした日付方式と 1904 年を基準とした日付方式の違いについて () https://support.microsoft.com/ja-jp/kb/214330

Microsoft Excel for Macintosh は、デフォルトでは 1904 年を基準とした日付方式を使用しています。初期の Macintosh コンピュータの設計により、1904 年 1 月 1 日より前の日付はサポートされていませんでした。この設計は、1900 年がうるう年ではないことに関連する問題を防止することが目的でした。

[2] Date - Xojo Documentation ( ()) https://docs.xojo.com/index.php/Date

A Date object stores the number of seconds since 12:00 AM, January 1, 1904.

[3] Unix Time vs. REALBasic time (Real Studio network user group Mailinglist archive) ( (Christian Schmitz著, )) http://www.monkeybreadsoftware.eu/listarchive-realbasic-nug/2004-04-27-3.shtml

REAL uses 01/01/1904 as the baseline while Unix uses 01/01/1970 as the

baseline

[4] Excel の 1900 年を基準とした日付方式と 1904 年を基準とした日付方式の違いについて () https://support.microsoft.com/ja-jp/help/214330/differences-between-the-1900-and-the-1904-date-system-in-excel

2 つの日付方式の日付の差は 1,462 日です。つまり、1900 年を基準とした日付方式の日付のシリアル値は、1904 年を基準とした日付方式の同じ日付のシリアル値よりも常に 1,462 日分大きくなります。

[5] Excelだけに存在する日付 | ユニリタブログ () http://www.unirita.co.jp/blog/data-utilization/data-linkage/20141202.html

データベースによっては、「特定の日付」より前の日付をマイナス数値で表すものもあるのですが、Excelは

「1900年から計算する」設定:「###~###」(扱えない値、の意)

「1904年から計算する」設定:絶対値が表す日付に「-」が付く

(例:1…1904/01/02、-1…-1904/01/02)

と処理されます。「1904年から計算する」設定ときの動作は、先に記載した日付の計算がマイナスになったときも表示できるようになったことの副作用だと思いますが、マイナスの西暦って何でしょうね?

[6] Excelだけに存在する日付 | ユニリタブログ () http://www.unirita.co.jp/blog/data-utilization/data-linkage/20141202.html

「1904年から計算する」設定では、数値「0」を日付に変換すると、上に書いたとおり

 

1904/01/01となります。

[7] Standard ECMA-376 () http://www.ecma-international.org/publications/standards/Ecma-376.htm ECMA-376 1st edition Part 4 1919ページ

date1904 (Date 1904)

Specifies a boolean value that indicates whether the date systems used in the workbook starts in 1904.

A value of on, 1, or true indicates the date system starts in 1904.

A value of off, 0, or false indicates the workbook uses the 1900 date system, where 1/1/1900 is the first day in the system.

The default value for this attribute is false.

The possible values for this attribute are defined by the XML Schema boolean datatype.

[8] time - perldoc.perl.org () https://perldoc.perl.org/functions/time.html

On most systems the epoch is 00:00:00 UTC, January 1, 1970; a prominent exception being Mac OS Classic which uses 00:00:00, January 1, 1904 in the current local time zone for its epoch.

[9] 電子機器の時刻 () http://www.ffortune.net/calen/calen/etime.htm

Macintoshのファイル管理システムであるHFS(および後継のHFS+)はファイルの時刻を1904年1月1日起点のLongInt(32bit)の秒数で持っています。1904年1月1日0時0分0秒の2**32=4294967296秒後は2040年2月6日6時28分16秒になるので、それをすぎると問題が生じることになります。

[10] Joel On Software私訳 () https://anond.hatelabo.jp/20080227113835

Excelのワークシートは色々なタイプのBIFFレコードの集まったものだ。私はスペックの一番最初のBIFFを見てみたい。1904と呼ばれるレコードだ。

Excelファイルフォーマット仕様のこのレコードについての記述は非常に曖昧なものだ。そこでは単に、1904レコードが「1904日付システムが使われているかどうか」を示すレコードだ、と述べているだけだ。ああ、使えない仕様書の典型的な一例だ。あなたがExcelファイルフォーマットで何かしている開発者で、そしてファイルフォーマット仕様にこう書いてあるのを見つけたなら、あなたがMiocrosoftは何かを隠しているのだと結論付けたとしても無理はない。この情報の断片は十分な情報をあなたに与えはしない。あなたには幾ばくか外部の情報が必要で、私は今ここで、それを提供しよう。Excelワークシートには、2種類ある。日付のエポックが1900/1/1のもの(これには、Lotus 1-2-3 との互換性のために故意に入れられた閏年に関するバグがあるが、ここでそれについて述べるのは退屈すぎる)、および、1904/1/1のものだ。Excelは両方をサポートしているが、それはExcelの最初のバージョンはMac版であり、それは単に簡単だったという理由でOSのエポックを使っていて、しかしWindows版のExcelは1-2-3のファイルをインポートできなくてはならず、そしてそれは1900/1/1をエポックとして採用していたからだ。あなたが涙ぐむのも無理はない。歴史のどの時点においても、プログラマが正しいことをしなかった、という時はないのだが、しかし現実にあなたが手にしているものはこれなのだ。

1900と1904のファイルタイプは両方とも世の中には広く存在しており、それは通常、ファイルがWindowsとMacのどちらで作られたかによる。一方のタイプから他方のタイプへ黙って変換するのはIntegrity的に問題があるので、Excelはファイルタイプを変換することをしない。Excelファイルをparseするためには、あなたは両方を扱わなくてはならない。それはファイルからこのbitをロードするだけの問題ではなく、あなたが日付表示と両方のエポックを扱うparsingのコードまで書き直さなくてはいけないということを意味する。実装には何日かかかるだろうと私は思う。

実際、あなたがExcelクローンの作業をするなら、日付の扱いについて、あらゆる種類の微妙なディティールを発見することになるだろう。Excelは日付の値をいつ変換するのか? 表示の整形はどうやっているのか? なぜ1/31は今年の January 31と翻訳され、また一方で1/50はJanuary 1st, 1950と翻訳されるのか? Excelのソースコードと同じだけの量のドキュメントを書かないがぎり、振る舞いに関しての微妙なビットを全て完全に記述することはできない。

[11] OpenTypeLONGDATETIME は、 からの秒数符号付き64ビット整数です。

[12] 年がうるう年かどうかを判断する方法 | Microsoft Docs (simonxjx, ) https://docs.microsoft.com/ja-jp/office/troubleshoot/excel/determine-a-leap-year

Excel 97 より前のバージョンの Microsoft Excel では 1900 年から 2078 年までの間にしか処理しないため、1900 年だけが、Microsoft Excel のうるう年の 100/400 除外規則の対象となります。 ただし、他のプログラムとの互換性を保つために、Microsoft Excel では 1900 年をうるう年として扱います。  

[13] MEW3 PktCDateLib (, ) https://web.archive.org/web/20001202204800/http://www3.gamewood.net/mew3/pilot/pocketc/pktcdate/index.html

This function is limited to the valid dates supported by PalmOS which are 1 January 1904 until 12 December 2031.

[14] PDB (Palm OS) - Wikipedia (, ) https://en.wikipedia.org/wiki/PDB_(Palm_OS)#PDB_Datetimes

Many PDB format files used times counting in seconds from 1904-01-01T00:00:00. This is the base time used by the original Macintosh (up to Mac OS 9). It may be noted that there were close links between Palm OS and Mac OS during early development. Using an unsigned 32-bit integer and the 1904 epoch, integer overflow will overflow will occur sometime in 2040.

Others may be observed to be counting from 1970-01-01T00:00:00 (the Unix epoch base time), and uses a signed 32-bit integer which will overflow sometime in 2038.

If the time has the top bit set, it's an unsigned 32-bit number counting from 1st Jan 1904

If the time has the top bit clear, it's a signed 32-bit number counting from 1st Jan 1970.

This is based on the idea that, otherwise the time would be before 1972 or before 1970 (depending on the interpretation) and the PDB format wasn't around then.

The palmdump utility and other software uses this rule-of-thumb when reading files.

[26] Palm OS Protein C/C++ Compiler Language and Library Reference - PalmOS_API_Compiler_Ref.pdf, , http://apitechwriter.com/Samples/PalmSource/PalmOS_API_Compiler_Ref.pdf#page=244

[27] subject:"Re\: Date limited to 2031", https://www.mail-archive.com/search?l=palm-dev-forum@news.palmos.com&q=subject:%22Re%5C%3A+Date+limited+to+2031%22&o=newest&f=1

[28] Palm, Inc. - Year 2000 Limited Warranty, , https://web.archive.org/web/20010119180600/http://www.palm.com/support/helpnotes/palmapps/year2000.html

[29] Time formatting and storage bugs - Wikipedia, , https://en.wikipedia.org/wiki/Time_formatting_and_storage_bugs#Year_2032

Palm OS also uses a 7-bit field for storing the year value, with a different epoch counting from 1904, resulting in a maximum year of 2031 (1904+127).

[16] アップルと西暦2000年問題 - システムソフトウエア, , http://radioc.web.fc2.com/weblib/y2k/apple/os.htm

[17] 1900 date system

QuickTime movies store date and time information in Macintosh date format: a 32-bit value indicating the number of seconds that have passed since midnight January 1, 1904.

This value does not specify a time zone. Common practice is to use local time for the time zone where the value is generated.

It is strongly recommended that all calendar date and time values be stored using UTC time, so that all files have a time and date relative to the same time zone.

[19] Time formatting and storage bugs - Wikipedia, , https://en.wikipedia.org/wiki/Time_formatting_and_storage_bugs#Year_1993

Mac SCI would attempt to use the date to determine how long a delay should last by getting the current time in seconds since 1 January 1904, the Macintosh epoch, and dividing by 12 hours. The division was processed by the Motorola 68000 and would not occur if an overflow was detected because of the division, but the Mac SCI would continue on regardless as if the division had occurred, eventually resulting in a delay of one second being treated as a delay for 18 hours and so on. Sierra released a patch called MCDATE that resolved the problem for almost 14 years.

[24] Time formatting and storage bugs - Wikipedia, , https://en.wikipedia.org/wiki/Time_formatting_and_storage_bugs#Year_2007

On 28 May 2007, the Motorola 68000 again does not divide due to overflow protection, which the Mac SCI ignores.

[30] Time formatting and storage bugs - Wikipedia, , https://en.wikipedia.org/wiki/Time_formatting_and_storage_bugs#Year_2040

Early Apple Macintosh computers store time in their real-time clocks (RTCs) and HFS filesystems as an unsigned 32-bit number of seconds since 00:00:00 on 1 January 1904. After 06:28:15 on 6 February 2040, (i.e. 232−1 seconds from the epoch), this will wrap around to 1904;