<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="15" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[15]</anchor-end> 
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Windows</anchor> では <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">NTFS</anchor> などで<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">整数時刻系</anchor>が使われています。</p><section><h1>元期</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[7]</anchor-end> <cite xml:lang="en-US">Why is the Win32 epoch January 1, 1601? – The Old New Thing</cite>
(<time>2017-01-09 16:48:01 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://blogs.msdn.microsoft.com/oldnewthing/20090306-00/?p=18913">https://blogs.msdn.microsoft.com/oldnewthing/20090306-00/?p=18913</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[8]</anchor-end> <cite>date - What is the significance of January 1, 1601? - Stack Overflow</cite>
(<time>2017-01-09 16:49:03 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://stackoverflow.com/questions/10849717/what-is-the-significance-of-january-1-1601">http://stackoverflow.com/questions/10849717/what-is-the-significance-of-january-1-1601</anchor-external></p><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="10" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[10]</anchor-end> <cite xml:lang="en">Active Directory: LastLogonTimeStamp Conversion - TechNet Articles - United States (English) - TechNet Wiki</cite>
( (<time>2017-01-24 16:00:13 +09:00</time>))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://social.technet.microsoft.com/wiki/contents/articles/12814.active-directory-lastlogontimestamp-conversion.aspx">https://social.technet.microsoft.com/wiki/contents/articles/12814.active-directory-lastlogontimestamp-conversion.aspx</anchor-external></figcaption><blockquote><p>Active Directory stores date/time values as the number of 100-nanosecond intervals that have elapsed since the 0 hour on January 1, 1601 until the date/time that is being stored. The time is always stored in UTC (Coordinated Universal Time, which used to be called Greenwich Mean Time, or GMT) in the Active Directory.</p></blockquote></figure><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="12" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[12]</anchor-end> <cite>SMB::Time - search.cpan.org</cite>
(<time>2017-02-13 00:39:40 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://search.cpan.org/dist/SMB/lib/SMB/Time.pm">http://search.cpan.org/dist/SMB/lib/SMB/Time.pm</anchor-external></figcaption><blockquote><p>NT time is number of 100-nanoseconds since 1601-01-01 00:00:00 UTC.</p></blockquote></figure><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="13" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[13]</anchor-end> <cite>NTタイムエポック値 について</cite>
(<time>2017-05-06 20:02:14 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://forest2forest.blogspot.jp/2016/02/nt.html">https://forest2forest.blogspot.jp/2016/02/nt.html</anchor-external></figcaption><blockquote><p>【LastLogonTimeStamp】属性にはNTタイムエポック値という値で記録される。</p><p>NTタイムエポック値とは、1601/01/01 00:00:00 から100ナノ秒単位のカウント値である。</p></blockquote></figure></section><section><h1>データ型と値域</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="24" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[24]</anchor-end> 
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">64ビット整数</anchor>で表されます。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="25" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[25]</anchor-end> 
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">符号無し整数</anchor>と解説されることが多いようですが、
<cite>Windows</cite>
の関係する <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">API</anchor>
は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">符号付き整数</anchor>としているものもあれば、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">符号無し整数</anchor>としているものもあり、
一貫していないところがあるようです。</p><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:">
<anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="38" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[38]</anchor-end> 
設計者が<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">人類史</anchor>レベルの記述能力を想定したのだとすると<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">符号付き整数</anchor>が妥当ですが、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">計算機</anchor>発明以後のみを扱うなら<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">符号無し整数</anchor>としても過剰なくらいです。
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ファイルシステム</anchor>以外への応用を構想していたのなら前者の能力が必要なのでしょうが、
現実にはほとんど<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ファイル</anchor>関係でしか使われず、どちらにしても持て余しています。</comment-p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="26" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[26]</anchor-end> 
<cite>Windows</cite> で実際に正常に取り扱えるのは、他の <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">API</anchor> や<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">データ構造</anchor>の関係もあり、
更に限定された範囲になるようです。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="27" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[27]</anchor-end> 
また、値 <n xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">0</n> が特殊値として使われることがあるようです。</p><hr></hr><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="28" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[28]</anchor-end> 
あまりに大きな数値のため、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">値域</anchor>の両端の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">年月日</anchor>を一般的な<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">日時処理</anchor>の実装では正確に扱えないことがあります。
そのためもあるのか、両端の値を記述していない解説も多く、記載していても他の資料と微妙に違う値のこともあります。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="29" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[29]</anchor-end> 
そこで <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ChatGPT</anchor> に両端の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">日時</anchor>を正確に計算するプログラムを作成させました。 <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="30" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;30</anchor-internal></src>
これによって得られた結果は、
次の通りです。すべて<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">先発グレゴリオ暦</anchor> / <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">先発UTC</anchor> / <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">閏秒のないUTC</anchor>の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">日時</anchor>です。</p><ul><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="31" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[31]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">64ビット符号付き整数</anchor><ul><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="32" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[32]</anchor-end> 最小 : <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キリスト紀元</anchor> -27627年 04月 19日 21時 11分 54秒 522ms 419μs 200ns
<code>-27627-04-19T21:11:54.522419200Z</code> <time>-27627-04-19T21:11:54.522419200Z</time></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="33" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[33]</anchor-end> 最大 : <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キリスト紀元</anchor> -30828年 09月 14日 02時 48分 05秒 477ms 580μs 700ns
<code>-30828-09-14T02:48:05.477580700Z</code> <time>-30828-09-14T02:48:05.477580700Z</time></li></ul></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="34" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[34]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">64ビット符号無し整数</anchor><ul><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="35" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[35]</anchor-end> 最小 : <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キリスト紀元</anchor> +01601年 01月 01日 00時 00分 00秒 000ms 000μs 000ns
<code>+01601-01-01T00:00:00.000000000Z</code> <time>1601-01-01T00:00:00.000000000Z</time></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="36" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[36]</anchor-end> 最大 : <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">キリスト紀元</anchor> +60056年 05月 28日 05時 36分 10秒 955ms 161μs 500ns
<code>+60056-05-28T05:36:10.955161500Z</code> <time>60056-05-28T05:36:10.955161500Z</time></li></ul></li></ul><refs xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><figure xmlns="http://www.w3.org/1999/xhtml" class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="30" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[30]</anchor-end> </figcaption><pre># 64-bit NTFS 時刻を正確に年・月・日・時・分・秒・ナノ秒に変換する(整数演算)

def ntfs_to_human(ntfs_time):
    &quot;&quot;&quot;
    NTFS 64bit 時刻 (100ns単位) -&gt; 年, 月, 日, 時, 分, 秒, ナノ秒
    &quot;&quot;&quot;
    # 基準日 1601-01-01
    base_year = 1601

    # 100ns -&gt; 秒とナノ秒
    total_seconds, remainder_100ns = divmod(ntfs_time, 10_000_000)
    nano = remainder_100ns * 100

    # 秒 -&gt; 日 + 秒
    days, seconds_of_day = divmod(total_seconds, 86400)
    hours, rem = divmod(seconds_of_day, 3600)
    minutes, sec = divmod(rem, 60)

    # グレゴリオ暦400年周期
    days_remaining = days
    # 400年 = 146097日
    n400, days_remaining = divmod(days_remaining, 146097)
    year = base_year + n400 * 400

    # 100年周期(ただし400年周期の最初の100年は閏年扱い注意)
    n100, days_remaining = divmod(days_remaining, 36524)  # 100年 = 36524日 (100年周期のうるう年除外)
    if n100 == 4:  # 400年ごとの最後の100年補正
        n100 = 3
        days_remaining += 36524
    year += n100 * 100

    # 4年周期
    n4, days_remaining = divmod(days_remaining, 1461)  # 4年 = 1461日
    year += n4 * 4

    # 1年周期
    n1, days_remaining = divmod(days_remaining, 365)
    if n1 == 4:  # 4年周期の最後の年補正
        n1 = 3
        days_remaining += 365
    year += n1

    # 閏年判定
    is_leap = (year % 4 == 0 and (year % 100 != 0 or year % 400 == 0))

    # 月・日計算
    month_days = [31, 29 if is_leap else 28, 31, 30, 31, 30,
                  31, 31, 30, 31, 30, 31]
    month = 1
    for md in month_days:
        if days_remaining &lt; md:
            day = days_remaining + 1
            break
        days_remaining -= md
        month += 1

    return year, month, day, hours, minutes, sec, nano

# signed / unsigned 64-bit 最大・最小値
signed_min = -2**63
signed_max = 2**63 - 1
unsigned_min = 0
unsigned_max = 2**64 - 1

# 計算
smin_human = ntfs_to_human(signed_min)
smax_human = ntfs_to_human(signed_max)
umin_human = ntfs_to_human(unsigned_min)
umax_human = ntfs_to_human(unsigned_max)

smin_human, smax_human, umin_human, umax_human</pre></figure></refs><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="37" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[37]</anchor-end> 
<cite xml:lang="en-us"><strong>[</strong>MS-DTYP<strong>]</strong>: FILETIME | Microsoft Learn</cite>, <time>2024-10-30T21:12:45.000Z</time>, <time>2026-01-01T09:38:18.876Z</time> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/2c57429b-fdd4-488f-b5fc-9e4cf020fcdf">https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/2c57429b-fdd4-488f-b5fc-9e4cf020fcdf</anchor-external></p><blockquote><p><b>dwLowDateTime:</b> A 32-bit unsigned integer that contains the low-order bits of the file time.</p><p><b>dwHighDateTime:</b> A 32-bit unsigned integer that contains the high-order bits of the file time.</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="17" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[17]</anchor-end> 
<cite xml:lang="en-US">Interpretation of NTFS Timestamps - Forensic Focus</cite>, <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Forensic Focus</anchor>, <time>2023-11-25T11:36:52.000Z</time> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://www.forensicfocus.com/articles/interpretation-of-ntfs-timestamps/">https://www.forensicfocus.com/articles/interpretation-of-ntfs-timestamps/</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="18" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[18]</anchor-end> 
<cite xml:lang="en-US">Interpretation of NTFS Timestamps - Forensic Focus</cite>, <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Forensic Focus</anchor>, <time>2026-01-01T08:36:48.000Z</time> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://www.forensicfocus.com/articles/interpretation-of-ntfs-timestamps/">https://www.forensicfocus.com/articles/interpretation-of-ntfs-timestamps/</anchor-external></p><blockquote><p>The documentation of <i>FileTimeToSystemTime()</i>, as well as practical tests,  indicate that the FILETIME value to be translated must be 0x7FFFFFFFFFFFFFFF or less.  This corresponds to the time 30828-09-14 02:48:05.4775807.</p></blockquote><blockquote><p>These system calls have a similar limitation in that only timestamps less than or equal to 0x7fffffffffffffff will be set.  Additionally, the two timestamp values 0x0 and 0xffffffffffffffff are reserved to modify the operation of the system call in different ways.</p><p>The reverse function, <i>SystemTimeToFileTime()</i>, performs the opposite conversion: translating a time expressed as the year, month, day, hours, minutes, seconds, etc into the 64-bit file time stamp. In this case, however, the span of time is restricted to years less than or equal to 30827.</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="19" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[19]</anchor-end> 
<cite xml:lang="en">c++ - Latest possible FILETIME - Stack Overflow</cite>, <time>2026-01-01T08:46:51.000Z</time> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://stackoverflow.com/questions/9999393/latest-possible-filetime">https://stackoverflow.com/questions/9999393/latest-possible-filetime</anchor-external></p><blockquote><p>My understanding is that <code>FILETIME</code> was made to represent any valid <code>SYSTEMTIME</code> in 64 bits. If you take the limit of <code>SYSTEMTIME</code> (last millisecond in 30827) then you end up with a <code>FILETIME</code> of <code>0x7fff35f4f06c58f0</code> by using <code>SystemTimeToFileTime()</code>.</p><p>However, if you put <code>0x7fffffffffffffff</code> into <code>FileTimeToSystemTime()</code> then you will end up in the year 30828, although this date is invalid for <code>SYSTEMTIME</code>. Any larger value (<code>0x8000000000000000</code> and above) causes <code>FileTimeToSystemTime()</code> to fail.</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="20" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[20]</anchor-end> 
<cite xml:lang="ja">Windowsのファイル時刻を扱うためのライブラリを作成した話</cite>, <time>2026-01-01T09:08:17.000Z</time> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://zenn.dev/sorairolake/articles/introduction-of-nt-time">https://zenn.dev/sorairolake/articles/introduction-of-nt-time</anchor-external></p><blockquote><p>最大値は60056年5月28日5時36分10秒955161500 (UTC) ですが、WindowsのAPIでは最大値は64ビット符号付き整数の最大値に制限されます。</p></blockquote><blockquote><p><code>FileTime::MAX</code> - <code>FileTime</code>が表すことのできる最大値 (+60056-05-28 05:36:10.955161500 UTC) を表します</p></blockquote><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <cite xml:lang="ja">システム時刻 - Wikipedia</cite>
(<time>2017-01-07 18:01:59 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://ja.wikipedia.org/wiki/%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E6%99%82%E5%88%BB">https://ja.wikipedia.org/wiki/%E3%82%B7%E3%82%B9%E3%83%86%E3%83%A0%E6%99%82%E5%88%BB</anchor-external></figcaption><blockquote><p>Microsoft Windows NTでは1601年1月1日0時0分(UTC)(先発グレゴリオ暦)からの100ナノ秒ティック単位での経過時間が主に用いられる。ただし後者は、現在時刻を最も近いミリ秒の値に近似している。</p></blockquote></figure><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> <cite xml:lang="ja">電子機器の時刻</cite>
(<time>2017-01-09 16:21:39 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://www.ffortune.net/calen/calen/etime.htm">http://www.ffortune.net/calen/calen/etime.htm</anchor-external></figcaption><blockquote><p>NTFSではファイルの時刻を1601年1月1日起点の64bitの経過時間で持っています。時間の単位は0.1μ秒です。1601年1月1日0時0分0秒の2**64=1844674407370.9551616秒後は60056年5月28日5時36分10.9551616秒になります。</p></blockquote></figure><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> <cite>日付時刻に関する処理</cite>
(<time>2015-12-14 13:39:42 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://home.a00.itscom.net/hatada/c-tips/datetime.html">http://home.a00.itscom.net/hatada/c-tips/datetime.html</anchor-external></figcaption><blockquote><p>FILETIME構造体は次のように定義された 1601 年 1 月 1 日午前 12 時からの 100 ナノ秒間隔の数 (UTC)を表す64ビット整数である。</p></blockquote></figure><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> <cite xml:lang="ja">厄介なActiveDirectoryの日付 « もみんぎゅぅ</cite>
(<time>2017-01-09 16:26:33 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://cmf.ohtanz.com/blog/archives/25">http://cmf.ohtanz.com/blog/archives/25</anchor-external></figcaption><blockquote><p>Windows 2003 ServerのActiveDirectory(Windowsすべての日付がそうなのかは不明ですが)上の日付というのは1601年1月1日から100ナノ秒(10000000分の1秒?)間隔というワケのワカラン仕様なのです</p></blockquote></figure><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[6]</anchor-end> <cite xml:lang="en">DateTime.ToFileTime Method (System)</cite>
(<time>2017-01-09 16:32:05 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://msdn.microsoft.com/en-us/library/system.datetime.tofiletime(v=vs.110).aspx">https://msdn.microsoft.com/en-us/library/system.datetime.tofiletime(v=vs.110).aspx</anchor-external></figcaption><blockquote><p>A Windows file time is a 64-bit value that represents the number of 100-nanosecond intervals that have elapsed since 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC). Windows uses a file time to record when an application creates, accesses, or writes to a file.</p></blockquote></figure><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[9]</anchor-end> <cite xml:lang="ja">FILETIME structure (Windows)</cite>
(<time>2017-01-09 17:30:07 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://msdn.microsoft.com/ja-jp/library/windows/desktop/ms724284.aspx">https://msdn.microsoft.com/ja-jp/library/windows/desktop/ms724284.aspx</anchor-external></figcaption><blockquote><p>Contains a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (UTC).</p></blockquote></figure><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="16" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[16]</anchor-end> <cite xml:lang="en">Time formatting and storage bugs - Wikipedia</cite>, <time>2023-11-24T03:13:21.000Z</time>, <time>2023-11-25T11:36:12.919Z</time> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://en.wikipedia.org/wiki/Time_formatting_and_storage_bugs#Year_30,828">https://en.wikipedia.org/wiki/Time_formatting_and_storage_bugs#Year_30,828</anchor-external></p><blockquote><p>Beginning 14 September 30,828, Windows will not accept dates beyond this day and on startup, it will display an error regarding &quot;invalid system time&quot; in NTFS. This is because the FILETIME value in Windows, which is a 64-bit value corresponding to the number of 100-nanosecond intervals since 1 January 1601, 00:00:00.0000000 UTC, will overflow its maximum possible value on that day at 02:48:05.4775808 UTC.<snip xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"></snip></p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="23" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[23]</anchor-end> 
<cite xml:lang="en-us">Test Cases for the RTC Real-Time Functions Test | Microsoft Learn</cite>, <time>2024-11-01T05:58:20.000Z</time>, <time>2026-01-01T09:16:24.873Z</time> <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://learn.microsoft.com/en-us/previous-versions/windows/embedded/bb330911(v=winembedded.60)?redirectedfrom=MSDN">https://learn.microsoft.com/en-us/previous-versions/windows/embedded/bb330911(v=winembedded.60)?redirectedfrom=MSDN</anchor-external></p><blockquote><p><snip xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"></snip>The test looks for the range beginning with the minimum possible FILETIME (FILETIME 0 is the start of Jan 1st 1601) and end with maximum possible FILETIME (Max FILETIME is the maximum 64-bit value).</p></blockquote></section><section><h1>文脈</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="21" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[21]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ファイルの時刻</anchor></p></section><section><h1>関連</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="14" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[14]</anchor-end> 
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">DOSの日時形式</anchor>はまた別のものでした。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="22" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[22]</anchor-end> 
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">COBOL整数日付</anchor>と<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">元期</anchor>が同じように見えて違うので注意。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="39" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[39]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ファイルの時刻</anchor></p></section><section><h1>メモ</h1><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end> <cite>真珠猫Blog: Windows時間をローカル時間に変換</cite>
(<time>2014-10-07 09:54:09 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://pearllynx.blogspot.jp/2013/03/windows.html">http://pearllynx.blogspot.jp/2013/03/windows.html</anchor-external></figcaption><blockquote><p>ActiveDirectryの情報をPerlで取得したりすると、最終ログイン日時やパスワード変更日時が上記の秒数になって表示されているので、変換する必要があります。</p></blockquote></figure><figure class="quote"><figcaption><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="11" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[11]</anchor-end> <cite>Mail::Exchange::Time - search.cpan.org</cite>
(<time>2017-02-13 00:39:08 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://search.cpan.org/dist/Mail-Exchange/lib/Mail/Exchange/Time.pm">http://search.cpan.org/dist/Mail-Exchange/lib/Mail/Exchange/Time.pm</anchor-external></figcaption><blockquote><p>A Mail::Exchange::Time object allows you to convert between unix time and the time used internally in by Microsoft, which is defined as number of 100-nsec-intervals since Jan 01, 1901.</p></blockquote></figure></section></body></html>