Ticks 640000000000000000
For more than 20 years I've been looking at DateTime.Ticks
Int64 values and they always look like 63nnnnnnnnnnnnnnnn, and I was wondering how long we must wait until the leading digits become 64.
A little bit of C# script using the DateTimeOffset struct
created the following table of waypoint tick values along the way to January 2029.
Ticks | Sort Date | Long Date | Span | Years |
---|---|---|---|---|
638900000000000000 | 2025-08-05 14:13:20 | Tuesday, 5 August 2025 14:13:20 | -3.00:08:14 | -0.01 |
639000000000000000 | 2025-11-29 08:00:00 | Saturday, 29 November 2025 08:00:00 | 112.17:38:25 | 0.31 |
639100000000000000 | 2026-03-25 01:46:40 | Wednesday, 25 March 2026 01:46:40 | 228.11:25:05 | 0.63 |
639200000000000000 | 2026-07-18 19:33:20 | Saturday, 18 July 2026 19:33:20 | 344.05:11:45 | 0.94 |
639300000000000000 | 2026-11-11 13:20:00 | Wednesday, 11 November 2026 13:20:00 | 459.22:58:25 | 1.26 |
639400000000000000 | 2027-03-07 07:06:40 | Sunday, 7 March 2027 07:06:40 | 575.16:45:05 | 1.58 |
639500000000000000 | 2027-07-01 00:53:20 | Thursday, 1 July 2027 00:53:20 | 691.10:31:45 | 1.89 |
639600000000000000 | 2027-10-24 18:40:00 | Sunday, 24 October 2027 18:40:00 | 807.04:18:25 | 2.21 |
639700000000000000 | 2028-02-17 12:26:40 | Thursday, 17 February 2028 12:26:40 | 922.22:05:05 | 2.53 |
639800000000000000 | 2028-06-12 06:13:20 | Monday, 12 June 2028 06:13:20 | 1038.15:51:45 | 2.84 |
639900000000000000 | 2028-10-06 00:00:00 | Friday, 6 October 2028 00:00:00 | 1154.09:38:25 | 3.16 |
640000000000000000 | 2029-01-29 17:46:40 | Monday, 29 January 2029 17:46:40 | 1270.03:25:05 | 3.48 |
If you want to wait until the leading digit changes from 6 to 7 then we have to wait until .
If you're wondering when the 64‑bit signed Ticks value will overflow and cause a new epochal form of millenium bug, then we have to wait about 29.2 million years.
Ticks Breakdown
Here is a nice breakdown of the digits in a Ticks value. Remember that the least significant digit (rightmost) is 100 nanoseconds (10-7 seconds).
Digit | Power | Seconds | Span | Years |
---|---|---|---|---|
6 | 10 | 10000000000 | 115740.17:46:40 | 316.881 |
3 | 9 | 1000000000 | 11574.01:46:40 | 31.688 |
8 | 8 | 100000000 | 1157.09:46:40 | 3.169 |
4 | 7 | 10000000 | 115.17:46:40 | 0.317 |
3 | 6 | 1000000 | 11.13:46:40 | 0.032 |
6 | 5 | 100000 | 1.03:46:40 | 0.003 |
6 | 4 | 10000 | 02:46:40 | |
3 | 3 | 1000 | 00:16:40 | |
3 | 2 | 100 | 00:01:40 | |
9 | 1 | 10 | 00:00:10 | |
2 | 0 | 1 | 00:00:01 | |
2 | -1 | 0.1 | 00:00:00.1 | |
4 | -2 | 0.01 | 00:00:00.01 | |
4 | -3 | 0.001 | 00:00:00.001 | |
6 | -4 | 0.0001 | 00:00:00.0001 | |
1 | -5 | 0.00001 | 00:00:00.00001 | |
3 | -6 | 0.000001 | 00:00:00.000001 | |
1 | -7 | 0.0000001 | 00:00:00.0000001 |
Doodling
The Ticks
property documentation says:
The value of this property represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001 in the Gregorian calendar, which represents MinValue.
Taking the popular approximation for the average length of a year being 365.25 days, we can divide the Ticks value by the number of 100 nanoseconds in an average year and add one (there was no year zero!) to get the approximate current year.
The actual value is 2025.571883 years, so it's close enough for jazz, ignoring some as yet unidentified rounding issues.