[23] Unix time は、 Unix 系システムを中心に多くの計算機システムで用いられている日時の内部表現形式 (整数時刻系) です。 計算機システム用の時刻系としては最も著名なものです。
[25] Unix time は、 元期1970年1月1日0時0分0秒 (UTC) (Unix epoch、The Epoch) から経過した秒単位の時間を数として表したものです。
[7] 負の値 (1969年以前) は、環境や文脈によっては扱えないことがあります。 最近は多くの環境が負の値も扱えるようになっているようです。
[37] time_t
は整数とするのが普通ですが、
それ以外では拡張して秒未満も含めた小数のUnix time
を使うことがよくあります。
[67] POSIX は1日の秒数を固定長としつつ、 実際の時刻との対応は未定義、実装定義とし >>10、閏秒の処置は曖昧にしています。 実装は leap smear などにより閏秒が存在しないものとして扱っています。
[69] right/
のような Unix システムで閏秒を扱う試みもありましたが、
Unix time との整合性を維持できず失敗しました。
[83] Unix time は UTC での Unix epoch からの経過時間を表しています。
[84] どこのどんな地方時 (標準時、サマータイム) を使っていて、それが UTC どどれだけの時差があるのであっても、 その時差情報は Unix time に含めることはできません。 Unix time はどの瞬間であるかだけを表します。
[6] C言語はデータ型 (typedef
) time_t を有しています >>65。
ISO C はその値の精度や値域を定めていません >>65 が、
現在では実質すべての実装が POSIX の定める Epoch すなわち
>>18 からの経過秒数
(Seconds Since the Epoch) >>10 の整数としています。
1970年未満については未定義としています >>10。
伝統的には32ビット符号なし整数でしたが、
2038年問題があり64ビット符号なし整数への移行が進んでいます >>66。
[68]
C言語は更に構造体 timespec
を定めています。 timespec
は
非負の time_t
の値を持つ tv_sec
と、
[ 0, 999999999 ] の long
値を持つ tv_nsec
の組で構成されます。ナノ秒精度の時刻の表現に使われます。 >>65
time.t
[11]
Perlにおける日時はプラットフォーム依存ですが、
ほとんどすべての場合 Unix time です。
場合によって小数の Unix time も使われます。
[71]
Ruby の Time
は Unix time
を使っています。値域はプラットフォーム依存です。
Time
[74] RFC 2783 - Pulse-Per-Second API for UNIX-like Operating Systems, Version 1.0, , https://tools.ietf.org/html/rfc2783#section-2
[114] NFS の timeval
, nfstime3
は、
Unix time の seconds
とミリ秒数の useconds
の構造体です。
>>113
[55] gzip の MTIME は、 Unix time を小エンディアンの 4バイト符号無し整数で表したものです。
A time field is an unsigned four-octet number containing the number of seconds elapsed since midnight, 1 January 1970 UTC.
[13]
RFC 4871 が定義する DKIM-Signature:
頭欄の t=
タグの値は、
1970年1月1日0時0分0秒 (UTC) からの秒数とされています。
ただし、閏秒は数えません。 RFC 4871 は、
実装に対して最低 1012 (≒ 紀元後20万年、≒ 40ビット符号無し整数)
までの値を扱えることを推奨 (SHOULD) しています。
更に、サービス拒否攻撃防止のために、
12桁以上の値は無限大とみなして構わない
(MAY) ともしています。
[31] SQL では時間帯を持たない日時のデータ型が使われることも多いですが、 その場合でも Unix time が使われることがあります。ここでの Unix time は、本来の 1970年1月1日0時 UTC からの秒数ではなく、 地方時のからの秒数とされています。
[20] MySQL では、 UNIX_TIMESTAMP
で日時を Unix time に、
FROM_UNIXTIME
で Unix time を日時に変換できます。
[2] oauth_timestamp
も Unix time 同等の定義となっています。
Its value is a JSON number representing the number of seconds from 1970-01-01T0:0:0Z as measured in UTC until the date/time.
A time value expressed in seconds since the UNIX epoch (i.e., zero hours, zero minutes, zero seconds, on January 1, 1970) Coordinated Universal Time (UTC) [POSIX].
Type: Integer
Example time representing 09:00:00 01/01/2000 UTC: 946717200
A JSON number, seconds since the UNIX epoch (00:00:00 UTC on 1 January 1970).
- gmt_unix_time
- The current time and date in standard UNIX 32-bit format (seconds since the midnight starting Jan 1, 1970, UTC, ignoring leap seconds) according to the sender's internal clock. Clocks are not required to be set correctly by the basic TLS protocol; higher-level or application protocols may define additional requirements. Note that, for historical reasons, the data element is named using GMT, the predecessor of the current worldwide time base, UTC.
[126] BinaryTime は、 RFC 4049 で規定された ASN.1の日時形式の一種で、 Unix time を使っています。 >>125
[116] MessagePack は、 Timestamp extension type を定めています。 ビット長の異なる3種類があります。 >>82
[117] 秒はいずれも Unix time。ナノ秒は [0, 999999999]。 仕様書に符号化・復号の方法が定められていますが、 ナノ秒に不正な値が与えられた時の検査は何もされていません。 >>82 これは意図したものであるようですが >>121、 その意図は不明です。 実装が厳密に検査するか否か、秒と秒未満を分けて保持するかどうかで、 挙動が変わってきそうで、 相互運用性・セキュリティー等の問題の温床にならないか懸念されます。
Tag value 1 is for numerical representation of seconds relative to 1970-01-01T00:00Z in UTC time. (For the non-negative values that the Portable Operating System Interface (POSIX) defines, the number of seconds is counted in the same way as for POSIX “seconds since the epoch” [TIME_T].) The tagged item can be a positive or negative integer (major types 0 and 1), or a floating-point number (major type 7 with additional information 25, 26, or 27). Note that the number can be negative (time before 1970-01-01T00:00Z) and, if a floating-point number, indicate fractional seconds.
Tag value 1 is for numerical representation of seconds relative to
1970-01-01T00:00Z in UTC time. (For the non-negative values that the
Portable Operating System Interface (POSIX) defines, the number of
seconds is counted in the same way as for POSIX "seconds since the
epoch" [TIME_T].) The tagged item can be a positive or negative
integer (major types 0 and 1), or a floating-point number (major type
7 with additional information 25, 26, or 27). Note that the number
can be negative (time before 1970-01-01T00:00Z) and, if a floating-
point number, indicate fractional seconds.
[111] DSSSL:
JIS X 4153:1998 8.5.11
「
[137] Java などで単位をミリ秒とするミリ秒Unix timeが使われています。
[136] BSON のUTC datetimeがミリ秒Unix time です。 MongoDB Extended JSON の日付の一種もミリ秒Unix timeです。
[14] Java の Calendar
>>27 や
JavaScript の Date
の値も Unix time
と同じ元期ですが、ミリ秒単位となっています。 (こちらも閏秒は考えません。)
[24] DOM の日時を扱う API (DOMTimeStamp
) も、
ミリ秒単位の千倍 Unix time を用いています。
[46] DateTime Wire Format でも使われています。
time, in milliseconds since 00:00:00 UTC on 1 January 1970
特定の時点は、1970 年 1 月 1 日 00:00:00.000 GMT (グレゴリオ暦) を元期とするミリ秒単位のオフセットで表現できます。
[138] Go言語などで単位をナノ秒とするナノ秒Unix timeが使われています。
[34] Go の Time
は、ナノ秒単位の Unix time
を用いています。
The zero value of type Time is January 1, year 1, 00:00:00.000000000 UTC.
[100] tantek は短縮URL で Unix epoch からの経過日数を New Base 60 で記述し、 epoch days と呼んでいます。 >>101
After that I use a 3 digit sexagesimal (Base60) number to represent the date in a manner deliberately limited to human individuals. Why Base60? Lots of reasons, including print-safety (as mentioned above). Want to read the entire derivation and reasons why? See NewBase60 (includes open source CASSIS implementation).
Why 3 sexagesimal digits to represent the date? It turns out that 3 sexagesimal digits are capable of representing over 500 years of days - plenty overengineered for any human lifetime. And if anyone does figure out how to live more than 500 years I have a feeling that person will not only not resemble human as we know it very much, but will either have bigger problems to deal with than URL shortener limitations, or will be so smart that they will come up with a better solution.
But for now, for our feeble less than 200 year lifetimes, this is good enough. In addition we can even agree on a day zero that computes well with existing platforms. Unix Epoch start: 1970-01-01. Given that no-one published anything to the web before 1990, I think we're ok with that. What happens in a few hundred years? Perhaps people can pick their own day zeroes as they see fit.
Thus the 3 characters after the "t" represent the number of days since 1970-01-01 in sexagesimal - what I'm calling "epoch days".
[59] 2038年問題は、 Unix time の桁溢れ問題です。
[75] 名無しさん: スラッシュドット ジャパン | 2038年問題、早くも顕在化 http://slashdot.jp/article.pl?sid=04/02/03/031211&topic=80
[76] [tz] DST ends 2040 in Oracle database () https://mm.icann.org/pipermail/tz/2019-January/027438.html
[77] Y2038ProofnessDesign - glibc wiki () https://sourceware.org/glibc/wiki/Y2038ProofnessDesign
[99] John Feminella 🌠さんはTwitterを使っています 「⏲️ As of today, we have about eighteen years to go until the Y2038 problem occurs. But the Y2038 problem will be giving us headaches long, long before 2038 arrives. I'd like to tell you a story about this.」 / Twitter, https://twitter.com/jxxf/status/1219009308438024200
[133] Investigating why Steam started picking a random font, http://blog.pkh.me/p/35-investigating-why-steam-started-picking-a-random-font.html
[134] >>133 時刻を進めて戻したらおかしなフォントが選ばれるようになった → フォントのタイムスタンプが2038年を超えているために桁溢れのエラーが(!)
[1] スラッシュドット ジャパン | 明日でepochから2^30秒 http://slashdot.jp/article.pl?sid=04/01/08/172200&mode=flat&commentsort=4&threshold=-1
[16] time_t - Wikipedia ( ( 版)) http://ja.wikipedia.org/wiki/Time_t
[17] Unix time - Wikipedia, the free encyclopedia ( ( 版)) http://en.wikipedia.org/wiki/Unix_time
[8] iPhoneを「1970年1月1日」に設定すると利用不能になる問題、Appleがソフト更新で解消へ - ITmedia ニュース ( 版) http://www.itmedia.co.jp/news/articles/1602/16/news132.html
[9] iPhoneで「1970年1月1日」に設定すると使用不能に? 実際に試してみた - ITmedia Mobile ( 版) http://www.itmedia.co.jp/mobile/articles/1602/12/news125.html
[19] WebDriver () https://w3c.github.io/webdriver/webdriver-spec.html#dfn-unix-epoch
2001年9月9日1時46分40秒にこの数字が十進数で9桁から10桁に変わりました。2chなどではこの数字を掲示板のidに使用しているため、この前後での掲示板の並べ替えがうまく行きません。
What is the epoch? Originally it was defined as the beginning of 1970 GMT. GMT, Greenwich Mean Time, is a traditional term for the time zone in England. Unfortunately, it is ambiguous; it can refer to a variety of astronomical time scales.
Arthur David Olson's popular time library uses an epoch of 1970-01-01 00:00:10 TAI.
The value returned by time is the offset in seconds from 01-JAN-1970 00:00:00 (just like the CRTL's times() routine), in order to make life easier for code coming in from the POSIX/Unix world.
[30] File API () https://w3c.github.io/FileAPI/#UnixEpoch
UnixNano returns t as a Unix time, the number of nanoseconds elapsed since January 1, 1970 UTC.
[36] SANS Digital Forensics and Incident Response Blog | Understanding EXT4 (Part 2): Timestamps | SANS Institute () https://digital-forensics.sans.org/blog/2011/03/14/digital-forensics-understanding-ext4-part-2-timestamps
[39] Add PushSubscription.expirationTime (#248) (beverloo著, ) https://github.com/w3c/push-api/commit/73da6411aac80de7de9bf5e65ee8eb4cc6a9aa24
[40] Epoch (astronomy) - Wikipedia () https://en.wikipedia.org/wiki/Epoch_(astronomy)
[41] General Concepts () http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16
NumericDate
A JSON numeric value representing the number of seconds from
1970-01-01T00:00:00Z UTC until the specified UTC date/time,
ignoring leap seconds. This is equivalent to the IEEE Std 1003.1,
2013 Edition [POSIX.1] definition "Seconds Since the Epoch", in
which each day is accounted for by exactly 86400 seconds, other
than that non-integer values can be represented.
定期購読の有効期限が、1970年1月1日 00:00:00 GMTからのミリ秒単位で表されています。
ASN.1フィールドタイプ:1708
ASN.1フィールド値: IA5STRING(RFC 3339の日付として解釈されます)
JSONフィールド名:expires_date
JSONフィールド値:数値
具体的には、1970年1月1日 00:00:00 GMTからのミリ秒数を表すlong値として表現されています。この原稿では、これを便宜的に「エポックからのミリ秒」と呼ぶことにします。なお、1970年1月1日 00:00:00 GMTについてJava言語APIでは、「エポック」と呼んでいます。
Amazon Redshift の EPOCH の実装は、サーバーのあるタイムゾーンから独立した 1970-01-01 00:00:00.000000 に関連します。
タイムスタンプ型の値は64ビットの符号付き整数としてエンコードされ、エポックとして知られる標準基準時間(1970年1月1日、GMT時間0時0分0秒)からのミリ秒数を表します。
The time at which the current rate limit window resets in UTC epoch seconds.
When providing Unix timestamps enter seconds[.nanoseconds], where seconds is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a fraction of a second no more than nine digits long.
ACCESS-NONCE 毎リクエストごとに増加する必要のある正の整数。通常はUNIXタイムスタンプを用います。最大値は 9223372036854775807 です。APIキーごとに管理されます。
[54] Make Event's timeStamp use DOMHighResTimeStamp (majido著, ) https://github.com/whatwg/dom/commit/912d58746bc4c67c2fd210124639f7c34991fce5
Git internal format
It is <unix timestamp> <time zone offset>, where <unix timestamp> is the number of seconds since the UNIX epoch. <time zone offset> is a positive or negative offset from UTC. For example CET (which is 1 hour ahead of UTC) is +0100.
[60] Unix time - Wikipedia () https://en.wikipedia.org/wiki/Unix_time
LHA では内部的にタイムスタンプを 1970-01-01 00:00:00 UTC からの通算秒 に変換しています。このため、実在しないスタンプ(80-00-00 など)を持った ファイルを格納した場合、タイムスタンプは不定となります。
[62] しかし保存先は MS-DOSの日時形式らしい。
03h DWORD 最終更新日時 (time_t形式)
When converting from system-dependent time_t format to the 32-bit
unsigned MTIME format used in gzip files, if a timestamp does not
fit gzip now substitutes zero instead of the timestamp's low-order
32 bits, as per Internet RFC 1952. When converting from MTIME to
time_t format, if a timestamp does not fit gzip now warns and
substitutes the nearest in-range value instead of crashing or
silently substituting an implementation-defined value (typically,
the timestamp's low-order bits). This affects timestamps before
1970 and after 2106, and timestamps after 2038 on platforms with
32-bit signed time_t. [bug present since the beginning]
[73] msgpack/spec.md at master · msgpack/msgpack () https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type
[78] 第25回 32ビット環境に迫る「2038年問題」 時計がおかしくなると…… (1/3) - ITmedia エンタープライズ () https://www.itmedia.co.jp/enterprise/articles/1607/13/news020.html
[79] KDDI、「2038年問題」で1346万円を過剰請求 - ITmedia NEWS () https://www.itmedia.co.jp/news/articles/0403/08/news023.html
[80] Package google.protobuf | Protocol Buffers | Google Developers () https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp
[87] 9月 9日 コンピュータの9月9日問題が発生(2001年)(ブルーバックス編集部) | ブルーバックス | 講談社 () https://gendai.ismedia.jp/articles/-/66915
[88] 上原 哲太郎/Tetsu. Uehara على تويتر: "いまいち認知が広がらない2038年問題ですが、Siriは知っています。Siriに世界の終わりを聞くとこう答えることがあります。… " (午前7:57 · 2018年9月26日 ) https://twitter.com/tetsutalow/status/1044722692576829440
2004年03月08日 16時56分 公開
3.99 time
A monotonically increasing value generated by a node. Time (0.0) starts at 00:00:00 GMT January 1, 1970.
Time (0.0) is equivalent to 00:00:00 GMT January 1, 1970. Absolute times are specified in SFTime or MFTime fields as double-precision floating point numbers representing seconds. Negative absolute times are interpreted as happening before 1970.
[92] VRML97, ISO/IEC 14772-1:1997 -- 5 Field and Event Reference () https://www.web3d.org/documents/specifications/14772/V2.0/part1/fieldsRef.html#SFTime
[93] LKML: Arnd Bergmann: [GIT PULL] y2038: core, driver and file system changes () https://lkml.org/lkml/2020/1/29/355
[94] 2038年問題に対応した「OpenBSD 5.5」リリース | OSDN Magazine () https://mag.osdn.jp/14/05/02/160000
[95] OpenBSD 5.5、2038年問題に対応 | スラド オープンソース () https://opensource.srad.jp/story/14/05/06/1839242/
time = xsd:decimal
The absolute time for this timestamp, in milliseconds since 1 January 1970 00:00:00 UTC.
Required: no, Default: none.
API パラメータでは、UNIX Time(1970年1月1日からの経過秒数)を指定する箇所と、YYYYMMDD のようなフォーマットの文字列形式で指定する箇所がありますが、いずれも UTC で指定します。
- New feature: Widen inode timestamps and quota grace expiration
timestamps to support dates through the year 2486.
xfs: widen ondisk inode timestamps to deal with y2038+
xfs: widen ondisk quota expiration timestamps to handle y2038+
xfs: trace timestamp limits
xfs: enable big timestamps
[104] Linux 5.10 to make Year 2038 problem the Year 2486 problem • The Register () https://www.theregister.com/2020/10/19/linux_5_10_y2k38_fixes/
[105] XFS File-System With Linux 5.10 Punts Year 2038 Problem To The Year 2486 - Phoronix () https://www.phoronix.com/scan.php?page=news_item&px=XFS-Linux-5.10
[106] Linuxカーネル5.6、32ビット版で2038年問題への対応が行われる | スラド Linux () https://linux.srad.jp/story/20/02/05/1249244/
[107] Pondering 2038 [LWN.net] (, ) https://lwn.net/Articles/563285/
[108] Linux 5.6 Is The First Kernel For 32-Bit Systems Ready To Run Past Year 2038 - Phoronix () https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.6-32-bit-Past-Y2038
[109] Linuxカーネル5.10、XFSファイルシステムの2038年問題に対処 | スラド Linux () https://linux.srad.jp/story/20/10/19/194204/
[110] GNU Coreutils: 28.9 Unix 紀元 (the Epoch) からの秒数 (, ) https://linuxjm.osdn.jp/info/GNU_coreutils/coreutils-ja_207.html
[112] Arthur David OlsonさんはTwitterを使っています 「It's Salute to the Seventies day at the @SSTransitCenter. Guess: a UNIX-derived computer operating on UTC drives this display and crashed 17 minutes before I captured this image. https://t.co/G3b12GQDue https://t.co/9Ze5qUN5ME」 / Twitter (午前4:22 · 2021年2月2日 , ) https://twitter.com/dashdashado/status/1356321947005628418
UNIX時間は,例外的にClassic Mac OSなど一部の古いシステムでは,UTC1904年1月1日00:00:00が紀元になることがあります。
[124] GNU C Library、Y2038対策でレガシーABIに64ビット時刻のサポートが追加 | スラド IT () https://it.srad.jp/story/21/06/17/1724219/
日付情報はUNIX Epoch(e.g.
1592528400
)
[129] DateTimeOffset.ToUnixTimeMilliseconds メソッド (System) | Microsoft Docs (dotnet-bot, ) https://docs.microsoft.com/ja-jp/dotnet/api/system.datetimeoffset.tounixtimemilliseconds?view=net-6.0#System_DateTimeOffset_ToUnixTimeMilliseconds
[130] 10億秒 | スラド () https://srad.jp/story/01/09/08/1027223/
[132] xssbnuny (furdu soon?)さんはTwitterを使っています: 「Boss: your leave request broke the system Me: uh sigh Boss: why do you want to take the specific week off in 2038 Me: for this exact reason」 / Twitter (, ) https://twitter.com/xssfox/status/1514493425248522245
tm
は閏秒を表現できることになっていますが、 Unix time で表現できないため有名無実となっています。