Code
Ways of writing that hide nothing by design — bases, bits, binary formats, floats, Unicode, Roman numerals, timestamps, coordinates, check digits — read and written both ways.
Timestamps
Converts computer timestamps both ways: Unix seconds and milliseconds, GPS week and seconds (IERS leap seconds), Windows FILETIME, Chrome/WebKit, .NET ticks, Excel serial, NTP, Apple, XRP Ledger, MJD and Julian Date, exact to 100 nanoseconds; a number of unknown kind is read in every format that fits. It also reads the time inside a UUID (RFC 9562), a ULID, a Snowflake or a MongoDB ObjectId.
History, how it works, how it was checked, limits
History
Unix time counts seconds since 1970-01-01 00:00 UTC without leap seconds (POSIX); FILETIME counts 100-nanosecond intervals since 1601, NTP seconds since 1900 (RFC 5905). GPS time began on 6 January 1980 and runs ahead of UTC by the leap seconds since, 18 from 2017; Excel keeps Lotus 1-2-3’s 29 February 1900 as serial 60. Identifiers carry a time too: RFC 9562’s UUIDs of versions 1, 6 and 7, ULIDs, Twitter’s Snowflakes of 2010 and MongoDB’s ObjectIds.
How it works
A moment is held as a BigInt count of 100-nanosecond ticks since 1970, as FILETIME and .NET values pass 2^53. GPS adds TAI − UTC − 19 s from the IERS list; Excel serials skip 60. Date → timestamp reads a date and time as local time or UTC; Timestamp → date reads a value in a chosen format or, under Any format, in every format that places it between 1980 and 2040. Identifier → time takes the time field of a UUID, ULID, Snowflake or ObjectId as its source lays it out, and draws the identifier’s bits with its fields named, the time in gold. Each moment is shown in UTC, local time, ISO 8601 and every format, and on the formats’ axis of years.
How it was checked
The Unix epoch gives FILETIME 116444736000000000 (Microsoft), NTP 2208988800 (RFC 5905), Excel 25569 and JD 2440587.5; 23:59:42 UTC on 6 April 2019 is GPS week 2048, second 0, both ways. Excel 45000 is 15 March 2023 and 60 is refused; every format reads back what it writes; Stockholm’s skipped and repeated hours of 2026 are told apart. RFC 9562’s test vectors of versions 1, 6 and 7 each give 2:22:22 PM GMT-05:00 on 22 February 2022, the ULID specification’s largest ULID its 2^48 − 1 milliseconds, MongoDB’s example its 32 seconds. The axis’s ends are pinned to their sources (RFC 5905, IS-GPS-200N).
The tests hold 78 checks of this tool; 9 rest on outside material, the first eight here:
- A standard’s own vectors Unix epoch → NTP (RFC 5905)
- A standard’s own vectors RFC 5905 §6: NTP’s 32-bit seconds from 1900 wrap at 2036-02-07 06:28:16 UTC, where era 1 begins
- A standard’s own vectors RFC 9562, Appendix A.1: the UUIDv1 test vector is version 1, its 60-bit timestamp 0x1EC9414C232AB00 (138648505420000000), 2:22:22 PM GMT-05:00 on 22 February 2022
- A standard’s own vectors RFC 9562, Appendix A.5: the UUIDv6 test vector holds the same 60-bit timestamp in time_high, time_mid and time_low
- A standard’s own vectors RFC 9562, Appendix A.6: the UUIDv7 test vector’s unix_ts_ms is 0x017F22E279B0, 1645557742000, the same moment
- A standard’s own vectors RFC 9562 §4.1: its variant bits 10 in all three test vectors; a version 4 UUID holds no time; a UUID of another variant is not read for one
- A standard’s own vectors RFC 9562: a UUID written as a URN, in braces or without hyphens is the same UUID
- A standard’s own vectors RFC 9562’s Nil and Max UUIDs are said as such, and version 2 is left to DCE, its time not read
The other 1, and every tool’s checks
Limits
Any format is a guess from plausible years, not a proof: 700000000 fits four formats. Local time is the device’s zone; a wall time the clocks skipped is read as the time shown after, one they repeated as the earlier. Only GPS counts leap seconds, by the list valid until 28 June 2027; only Excel’s 1900 system is read. A Snowflake does not say whose it is: it is read as Twitter’s unless Discord’s is chosen or it is past 2⁶³ − 1, and no printed example of either was read to test it on.
- The Open Group Base Specifications (IEEE Std 1003.1), “Seconds Since the Epoch”
- Microsoft, “FILETIME structure”, Win32 API documentation
- IERS, leap-seconds.list (Bulletin C)
- D. Mills et al., RFC 5905, Network Time Protocol Version 4 (2010), §6
- IS-GPS-200N, Navstar GPS Space Segment/Navigation User Interfaces (2022), §20.3.3.3.1.1 and §30.3.3.1.1.1
- Microsoft, “FileTimeToSystemTime function” and “DateTime.MaxValue Field”
- Microsoft, “Excel specifications and limits”
- The Linux kernel documentation, “ktime accessors” (timekeeping): the year 2038 on 32-bit architectures
- K. Davis, B. Peabody and P. Leach, RFC 9562, Universally Unique IDentifiers (UUIDs) (2024), §5.1, §5.6, §5.7 and Appendix A
- The ULID specification
- Twitter, Snowflake (2010), IdWorker.scala
- Discord, Developer documentation, “Snowflakes”
- MongoDB, “ObjectId()”, MongoDB Manual