The Unix timestamp will begin with 16 this Sunday
unixtimestamp.com
unixtimestamp.com
500M seconds later I was in Washington DC in a hotel, watching it tick up on an rxvt on my laptop, with HN in a window.
Who knows where I'll be in 2033, hopefully not in Europe as I'll be too old for night shifts, but wherever I am, I suspect it will have a bash prompt.
Why do you wait for these events ? Myself I consider these to be complete non-events.
It's an arbitrary thing people do for fun.
Incidentally, I guess the windows/NT epoch started in 1601.
Almost all things that have a timestamp leave you in no doubt which 136-year period they were taken in. For those, 32 bits is plenty.
Think of an odometer for a car with 999999 as its max number. 999,999 is equivalent to -1. So 500 + 999999 == 499 on the odometer.
A 32-bit register is simply a binary odometer, so the above concept happens with bits.
In "signed int", we print the number "999999" as "-1". With "unsigned int", we print the number "999999" as "999999". They are one-and-the-same. The only difference is your print() function.
-----
Multiplication and division change however. Your compiler tracks signed/unsigned status for idiv vs div, or mul vs imul instructions.
--------
With that being said: I think 64-bits is fine. Most computers these days are 64-bits, and those 4-extra bytes aren't very costly. Standard compression algorithms, like GZip, do a good job of finding those redundant bits and shrinking things down.
Except signed overflow invoking Undefined Behaviour in any C compiler, whereas unsigned overflow does not.
This invokes undefined behaviour:
foo(int x) {
return x + 1 > x;
}IIUC, GP's foo() would likely be optimized to { return true; }, and so would similar timestamp overflow checks.
Given this thread of subargument, making the difference between 32-bit unsigned numbers is MORE DEFINED than using signed integers.
-------
IE: If your code was correct with "int timestamp", it will be more correct with "unsigned int timestamp".
In any case, "int" or "unsigned int" based timestamp manipulation wouldn't be like the code you suggested, but instead "int difference = x - y".
In the signed integer case, "difference" is (conceptually) negative, while in the unsigned integer case, "difference" is guaranteed to have overflow. Both cases are conceptually correct with regards to the difference of timestamps.
To get meaningful results may require some care, but the languages provide everything needed to exercise such care.
> Except signed overflow invoking Undefined Behaviour in any C compiler, whereas unsigned overflow does not.
We aren't talking about unsigned integer types. We're talking about the behaviour of signed integer types.
Existing code that deals with 32-bit timestamps almost universally assumes that (time_t)0 is 1970-01-01 00:00:00 UTC. Updating that code to guess a different epoch would be more work (with more inevitable bugs) than keeping a fixed epoch and using 64 bits.
It's already 64 bits (and signed) on a lot of systems.
---
Openldap got hit by the billennium bug. I remember because we told our Noc to keep an eye open (Sunday afternoon where we were) and we started getting alerts that all LDAP replication was broken.
https://www.openldap.org/lists/openldap-bugs/200109/msg00052...
---
Link to 1400000000 thread:
I don't think I was at the only company doing this. Few people seem to care about issues that will happen after their retirement. Expect lots of industrial stuff to work just a bit worse around 2038 (and 2036, PIC microcontrollers fail a bit sooner)
http://www.davideous.com/imap-maildir/#updates
The sort function couldn't handle the rollover so when we came in that day all our mailboxes had their email sorted in the wrong order, and it couldn't be fixed without the listed patch.
There's always "xclock -d -update 1 -strftime %s -face Inconsolata-190:bold "
`watch -n1 date` will update every second.
Inconsolata wasn't released until 2006.
> 03:46:49 -crier- THE BILLENNIUM HAS ARRIVED!!!!! Uh, you might want to play auldlangsyne.wav. YAAAAAAAAAAAAAAAYYYYYY!
more at https://pastebin.com/71H7eR8r
For some reason the billennium arrives at 3:46:49, which doesn't make sense - I wasn't in UTC+2, and anyway this should've been at 01:46:40am UTC (40 seconds past the minute, not 49 seconds). Most likely reason is simply that my local machine's clock was wrong.
Python:
$ python3 -q
>>> from datetime import datetime
>>> datetime.utcfromtimestamp(1_600_000_000)
datetime.datetime(2020, 9, 13, 12, 26, 40)
GNU date (Linux): $ date -ud @1600000000
Sun Sep 13 12:26:40 UTC 2020
BSD date (macOS, FreeBSD, OpenBSD, etc.): $ date -ur 1600000000
Sun Sep 13 12:26:40 UTC 2020
All such dates (in UTC) until the end of the current century: $ python3 -q
>>> from datetime import datetime
>>> for t in range(0, 4_200_000_000, 100_000_000): print(f'{t:13_d} - {datetime.utcfromtimestamp(t).strftime("%Y-%m-%d %H:%M:%S")}')
...
0 - 1970-01-01 00:00:00
100_000_000 - 1973-03-03 09:46:40
200_000_000 - 1976-05-03 19:33:20
300_000_000 - 1979-07-05 05:20:00
400_000_000 - 1982-09-04 15:06:40
500_000_000 - 1985-11-05 00:53:20
600_000_000 - 1989-01-05 10:40:00
700_000_000 - 1992-03-07 20:26:40
800_000_000 - 1995-05-09 06:13:20
900_000_000 - 1998-07-09 16:00:00
1_000_000_000 - 2001-09-09 01:46:40
1_100_000_000 - 2004-11-09 11:33:20
1_200_000_000 - 2008-01-10 21:20:00
1_300_000_000 - 2011-03-13 07:06:40
1_400_000_000 - 2014-05-13 16:53:20
1_500_000_000 - 2017-07-14 02:40:00
1_600_000_000 - 2020-09-13 12:26:40
1_700_000_000 - 2023-11-14 22:13:20
1_800_000_000 - 2027-01-15 08:00:00
1_900_000_000 - 2030-03-17 17:46:40
2_000_000_000 - 2033-05-18 03:33:20
2_100_000_000 - 2036-07-18 13:20:00
2_200_000_000 - 2039-09-18 23:06:40
2_300_000_000 - 2042-11-19 08:53:20
2_400_000_000 - 2046-01-19 18:40:00
2_500_000_000 - 2049-03-22 04:26:40
2_600_000_000 - 2052-05-22 14:13:20
2_700_000_000 - 2055-07-24 00:00:00
2_800_000_000 - 2058-09-23 09:46:40
2_900_000_000 - 2061-11-23 19:33:20
3_000_000_000 - 2065-01-24 05:20:00
3_100_000_000 - 2068-03-26 15:06:40
3_200_000_000 - 2071-05-28 00:53:20
3_300_000_000 - 2074-07-28 10:40:00
3_400_000_000 - 2077-09-27 20:26:40
3_500_000_000 - 2080-11-28 06:13:20
3_600_000_000 - 2084-01-29 16:00:00
3_700_000_000 - 2087-04-01 01:46:40
3_800_000_000 - 2090-06-01 11:33:20
3_900_000_000 - 2093-08-01 21:20:00
4_000_000_000 - 2096-10-02 07:06:40
4_100_000_000 - 2099-12-03 16:53:20 (Get-Date "1/1/1970").AddSeconds(1600000000).ToUniversalTime()
or alternatively for your local time: (Get-Date "1/1/1970").AddSeconds(1600000000).ToLocalTime()Since the Kind property is readonly, to get the real UTC date you need:
$naive = (Get-Date "1/1/1970").AddSeconds(1600000000)
$local = $naive.ToLocalTime()
$utc = $local.ToUniversalTime() $utc = [DateTimeOffset]::FromUnixTimeSeconds(16e8).UtcDateTime
Incidentally, PS> ($utc, (Get-Date -AsUtc '1/1/1970'), (Get-Date -AsUtc), (Get-Date)).Kind
Utc
Utc
Utc
Local
In your example, $naive.Kind -eq [DateTimeKind]::Unspecified
correctly, because no DateTimeKind was specified.The peculiar behavior you observed with ToLocationTime and ToUniversalTime exists to avoid breaking changes in working[1] code written for versions of the .NET Framework before 2.0, where DateTime.Kind was introduced (as was DateTimeOffset, so ToLocationTime and ToUniversalTime should probably be deprecated).
[1] "Breaking" changes exist for already-broken code, e.g., in Framework 2.0 and later, the return values of ToUniversalTime and ToLocalTime have Kinds Utc and Local, respectively, so applying the same conversion to an already-converted value no longer has any effect.
$ date -r 1600000000
Sun Sep 13 05:26:40 PDT 2020for t in {0..4100000000..100000000}; do TZ=UTC printf "%'13d - %(%Y-%m-%d %H:%M:%S)T\n" $t $t; done
Though `dateutil` is still recommended for most cases.
We're going to party like it's 2099! Watch out for that Y2K+100 bug!!
% jot - 10 20 | while read -r d
do
printf "@40000000%08x%08x %s00Ms SI since the Unix v4 Epoch\n" \
"$d"00000010 0 "$d"
done |
TZ=right/UTC tai64nlocal
2001-09-09 01:46:18.000000000 1000Ms SI since the Unix v4 Epoch
2004-11-09 11:32:58.000000000 1100Ms SI since the Unix v4 Epoch
2008-01-10 21:19:37.000000000 1200Ms SI since the Unix v4 Epoch
2011-03-13 07:06:16.000000000 1300Ms SI since the Unix v4 Epoch
2014-05-13 16:52:55.000000000 1400Ms SI since the Unix v4 Epoch
2017-07-14 02:39:33.000000000 1500Ms SI since the Unix v4 Epoch
2020-09-13 12:26:13.000000000 1600Ms SI since the Unix v4 Epoch
2023-11-14 22:12:53.000000000 1700Ms SI since the Unix v4 Epoch
2027-01-15 07:59:33.000000000 1800Ms SI since the Unix v4 Epoch
2030-03-17 17:46:13.000000000 1900Ms SI since the Unix v4 Epoch
2033-05-18 03:32:53.000000000 2000Ms SI since the Unix v4 Epoch
%
Also, your figures for 0.0Gs and 0.1Gs are nonsense anyway.Unix didn't adopt this Epoch and method of timekeeping until 4th Edition, somewhere in 1974 according to Unix historians. Yes, it's tricky to pin down the exact date of adoption. The Epoch was changed every year before then, as earlier versions of Unix measured time in 60ths of a second since the start of the year. This has made reconstructing Unix history from tape archives non-trivial. If you want to count seconds since the start of the first Unix Epoch, in 1st Edition, you have to count from the start of 1971. And no, that's not the same as how old Unix is.
(And yes, those values for 2023 onwards are somewhat speculative, as there will no doubt be more leap seconds.)
But there really is no reason to get rid of the unix timestamp as a measure of time and this measure may stay around for a long time. This may mean that people in the future might consider 1970 as year zero where modern civilization began.
In addition, you will probably want clocks that run at a given perceived speed, to time physical processes that take the same time everywhere (e.g. so your cookie recipe saying "bake for 600 seconds" work without translation).
You don't need science fiction for this.
* https://www.bipm.org/en/bipm-services/timescales/time-ftp/Ci...
Programmer: Hold my beer
Programmer: Next iteration of unix-time should include the concept of local time in context of relativity if we are going to travel or communicate over significant distances.
Einstein: Hold my beer
How do you even measure a global value when the local perspective by definition changes the value?
As opposed to eunuchs.
Another handy time_t approximation is that a year is about 2^25 seconds, or 32 megaseconds.
“Most years, since its inception in 1999, Vinge has been on the Free Software Foundation's selection committee for their Award for the Advancement of Free Software.”[0]
Since “A Deepness in the Sky” was written in 1999 as a prequel to “A Fire Upon the Deep” (from 1992), which do you recommend to read first?
Many people didn't like Deepness much. But the sequel to Fire, Children of the Sky, was interesting.
The Peace War is a fascinating exploration of "what if this one thing was possible?" and all its terrible consequences, but Deepness grabbed me much more as a story.
It's extremely weird and IMHO completely ruins the purpose of a timestamp, but it's a compromise for backwards compatibility, since Unix time was created before leap seconds. This hack ensures that the number of seconds in a day remains fixed, an assumption of many systems at the time.
Number of seconds since a given time seems fine until we're travelling significantly outside of a common reference plane.
Unix time decrees every day has exactly 86400 seconds. But the introduction of leap seconds means that While most days have 86400, some earth days have 86401 seconds and potentially there could also be days with 86399
TAI makes sense everywhere, Unix time only on earth.
Unix time is [...] the number of seconds that have elapsed since the Unix epoch, minus leap seconds.
- Wikipedia
If you are on Mars you'll have to update your computer time every ~6 months when Earth release a new table of leap seconds caused by e.g. earthquakes.
In a broad sense, the answer goes like this: Almost everything in the galaxy shares an approximate reference frame when it comes to velocity and special relativity. For general relativity and gravity, that's obviously a distortion so it doesn't count.
In the long term, to prevent very minor drift, we can use quasars as a reference.
"Local seconds since 1970", vs. "Static seconds since 1970".
Also, "since Unix time was created before leap seconds." I found this interesting for the simple reason I've never spent any time thinking about Epoch vs Leap Second histories.
tm_sec + tm_min*60 + tm_hour*3600 + tm_yday*86400 +
(tm_year-70)*31536000 + ((tm_year-69)/4)*86400 -
((tm_year-1)/100)*86400 + ((tm_year+299)/400)*86400Go and read about "right" versus "posix" timezones.
So it's cyclic and doesn't make sense outside the earth reference frame
Edit: since 2019, 1 second is defined by taking the fixed numerical value of the caesium frequency ∆νCs, the unperturbed ground-state hyperfine transition frequency of the caesium-133 atom, to be 9192631770 when expressed in the unit Hz, which is equal to s−1
So a second makes sense in the galactic scale at least as long as Caesium-133 is a stable isotope in that environment
> realisation of the metre is usually delineated (not defined) today in labs as 1579800.762042(33) wavelengths of helium-neon laser light in a vacuum
Ironically, your kernel measures TAI time perfectly happily if unmolested, as that always ticks once for every SI second (ignoring oscillator drift). No slewing. No smearing. No stepping.
We could eventually arrive at stardates with one starday being 100000 seconds. Of course, that would be just as arbitrary as simply keeping the 24 hours of 60 minutes each.
http://www.chronobiology.ch/wp-content/uploads/publications/...
They were very limited, though. We do not really know what would happen on a spaceship that changed its day to 100 000 seconds and subjected the crew to this cycle for months or years.
Given how adaptable people usually are to external influences, I would guess that some adaptation would take place.
Carl Sagan put a quasar GPS on a golden plaque on both Voyager probes, so future intelligences could tell where and when the Voyagers came from.
Beginning on September 13, 2020 at 12:26:39 PM Coordinated Universal Time (UTC), un-patched Splunk platform instances will be unable to recognize timestamps from events with dates that are based on Unix time, due to incorrect parsing of timestamp data.
https://docs.splunk.com/Documentation/Splunk/latest/ReleaseN...
What's super daft is the proposed fix is only a further sticking plaster, adding support for the 16... range (and the 2020s decade) rather than all future dates. So in a couple of years a further patch will be needed...
> Beginning on January 1, 2020, un-patched Splunk platform instances will be unable to recognize timestamps from events where the date contains a two-digit year. This means data that meets this criteria will be indexed with incorrect timestamps.
> Beginning on September 13, 2020 at 12:26:39 PM Coordinated Universal Time (UTC), un-patched Splunk platform instances will be unable to recognize timestamps from events with dates that are based on Unix time, due to incorrect parsing of timestamp data.
> Impact
> ...
> The issue appears when you have configured the input source to automatically determine timestamps, ...
> There is no method to correct the timestamps after the Splunk platform has ingested the data when the problem starts. If you ingest data with an un-patched Splunk platform instance beginning on January 1, 2020, you must patch the instance and re-ingest that data for its timestamps to be correct.
> Cause
> The Splunk platform input processor uses a file called datetime.xml to help the processor correctly determine timestamps based on incoming data. The file uses regular expressions to extract many different types of dates and timestamps from incoming data.
> On un-patched Splunk platform instances, the file supports the extraction of two-digit years of "19", that is, up to December 31, 2019. Beginning on January 1, 2020, these un-patched instances will mistakenly treat incoming data as having an invalid timestamp year, and could either add timestamps using the current year, or misinterpret the date incorrectly and add a timestamp with the misinterpreted date.
code:
#!/bin/bash
for t in $(seq 0 100000000 $((2* * 31))); do date -u -d @$t +'%s -> %c'; done
output:
0 -> Do 01 Jan 1970 00:00:00 UTC
100000000 -> Sa 03 Mär 1973 09:46:40 UTC
200000000 -> Mo 03 Mai 1976 19:33:20 UTC
300000000 -> Do 05 Jul 1979 05:20:00 UTC
400000000 -> Sa 04 Sep 1982 15:06:40 UTC
500000000 -> Di 05 Nov 1985 00:53:20 UTC
600000000 -> Do 05 Jan 1989 10:40:00 UTC
700000000 -> Sa 07 Mär 1992 20:26:40 UTC
800000000 -> Di 09 Mai 1995 06:13:20 UTC
900000000 -> Do 09 Jul 1998 16:00:00 UTC
1000000000 -> So 09 Sep 2001 01:46:40 UTC
1100000000 -> Di 09 Nov 2004 11:33:20 UTC
1200000000 -> Do 10 Jan 2008 21:20:00 UTC
1300000000 -> So 13 Mär 2011 07:06:40 UTC
1400000000 -> Di 13 Mai 2014 16:53:20 UTC
1500000000 -> Fr 14 Jul 2017 02:40:00 UTC
1600000000 -> So 13 Sep 2020 12:26:40 UTC
1700000000 -> Di 14 Nov 2023 22:13:20 UTC
1800000000 -> Fr 15 Jan 2027 08:00:00 UTC
1900000000 -> So 17 Mär 2030 17:46:40 UTC
2000000000 -> Mi 18 Mai 2033 03:33:20 UTC
2100000000 -> Fr 18 Jul 2036 13:20:00 UTC
--------------------------------------------------------------
overflow of currently used datatype for timer happening at:
code:
#!/bin/bash date -u -d @2147483648 +'%s -> %c'
output:
2147483648 -> Di 19 Jan 2038 03:14:08 UTC
info:
https://en.wikipedia.org/wiki/Year_2038_problem
--------------------------------------------------------------
other interesting date:
pi day:
date -u -d @3141592653 +'%s -> %c'
3141592653 -> So 21 Jul 2069 00:37:33 UTC (100th birthday for moonlanding mission on pi-day/sec)
So Sunday
Mo Monday
Di Tuesday
Mi Wednesday
Do Thursday
Fr Friday
Sa Saturday
I think those are German.[0]: https://www.wolframalpha.com/input/?i=1e8+seconds+in+months
Back then, Earth's population was on 3.7 billion. Now it's 7.8 billion. That means that (ignoring deaths) 2.5 babies have been born for each unix second. Or roughly 1 baby every 400 milliseconds.
Only thing I want to add: not yet, maybe with CRISPR and artificial wombs there could be some way.
Also, see: https://www.worldometers.info/
If you have a billion (i.e., 1E9) dollars, or any other currency, and you spend $86,400 dollars a day, it will take you more than 31 years and 8 months to spend the entire billion.
[1]https://wolfram74.github.io/ArabIntToMayaInt/countdown.html
I worked in Corporate IT at the time, so most of the office had no idea what we were celebrating. Somehow, neither did 80% of the tech staff. But the few of us who appreciated it really enjoyed the cake.
1. Given month 1 <= m <= 12, day 0 of that month (i.e., the day before the first of the month) in a non-leap year is day 30(m-1) + F[m] of the year, where F[m] is from this array (1-based indexing!):
0, 1, -1, 0, 0, 1, 1, 2, 3, 3, 4, 4
Add the day, and add 1 if it is a leap year and m >= 3.E.g., September 12. m = 9, giving 240 + F[9] = 243 for Sep 0. Add 12 for the day, and 1 for the leap year, giving 256.
The F table has enough patterns within it to make it fairly easy to memorize. If you prefer memorizing formulas to memorizing tables, you can do months m >= 3 with F[m] = 6(m-4)//10, where // is the Python3 integer division operator. Then you just need to memorize the Jan is 0, Feb is 1, and the rest are 6(m-4)//10.
2. If you have the month terms from the Doomsday algorithm for doing day of week calculations already memorized, you can get F]m] from that instead of memorizing the F table.
F[m] == -(2m + 2 - M[m]) mod 7, where M[m] is the Doomsday month term (additive form): 4, 0, 0, 3, 5, 1, 3, 6, 2, 4, 0, 2.
You then just have to remember that -1 <= F <= 4, so adjust -(2m + 2 -M[m]) by an appropriate multiple of 7 to get into that range.
BTW, you can run use that formula relating F[] and M[] the other way. If you have F[], them M[m] = F[m] + 2 m + 2 mod 7. Some people might find it easier to memorize F and compute M from that when doing day of week with Doomsday rather than memorize M.
* 0x6000 0000
% printf "@40000000%08x%08x %#xs SI since the Unix v4 Epoch\n" \
0x6000000A 0 0x60000000 |
TZ=right/UTC tai64nlocal
2021-01-14 08:25:09.000000000 0x60000000s SI since the Unix v4 Epoch
%https://twitter.com/time_t_emit
It's going to tweet twice tomorrow at lunch time (in my time zone) either side of the rollover.
I fondly remember the gigasecond party I went to with a load of friends - it happened in the small hours on Sunday morning, ideal party time for a bunch of geeks in their 20s, like an extra new year's eve!
- GMT is a time zone officially used in some European and African countries. The time can be displayed using both the 24-hour format (0 - 24) or the 12-hour format (1 - 12 am/pm).
- UTC is not a time zone, but a time standard that is the basis for civil time and time zones worldwide. This means that no country or territory officially uses UTC as a local time.
Wish I knew when 1234567890 happened, I was too dumb back then.
Coincidentally I consider this the end of "golden age" of the internet which ended as soon as the iPhone and smartphones in general got mainstream and everything moved to centralized services.
I can only recommend using https://epochconverter.com instead of Google's preferred result https://unixtimestamp.com as it automatically detects if milliseconds are included, and it displays the local time more prominently.
https://github.com/williame/TimeMillis
It’s probably not as fast as it could be: all speed ups and improvements welcome!
what would be the problems with choosing a new epoch (i.e. one where jan 1 is the same day of week as jan 1, 1970 and is 2 years before a leap year. (perhaps doesn't exist).
The worse case I see is that apps that calculate years internally (instead of via a shared library or like) would calculate them incorrectly. I'm wondering if this wouldn't be something that could be massaged around. Of course, it just pushes the problem down the road.
it also makes timestamps like this incompatible between systems that have different epochs, which could be an issue.
as I said, naive (possibly stupid) Q, just wondering if people have actually talked about it?
https://en.wikipedia.org/wiki/Year_2038_problem#Possible_sol...
https://en.wikipedia.org/wiki/Epoch_(computing)#Notable_epoc...
>>> import datetime
>>> datetime.datetime.now().timestamp()
1599923432.252943
>>> datetime.datetime.fromtimestamp(16e8)
datetime.datetime(2020, 9, 13, 8, 26, 40)You probably meant “Au revoir”. Then again, “Au revoir” means roughly “Until we meet again”, and we won’t be seeing the “15” prefix again.
[0] Yes, I know this doesn't get transformed here.
Last I looked, plenty of fixes were trickling into the kernel in 2014. I wonder how many of those made the long backport to stable.
Let alone all those 2.6 kernels (and older!) in the wild. And all your 32-bit devices are probably gonna have a bad time.
Various libc choices in use probably have time_t signed.
Nervous nellies worried about rollover, and insisting we switch to 64-bit timestamps everywhere, are a nuisance. You can keep one 64-bit epoch, such as boot time or most recent foreign attack on NYC, and as many 32-bit offsets from that as you like, and always be able to get a 64-bit time whenever you need it. Most often you only need a difference, so one epoch is as good as any, and you can work purely in 32 bits.
Pcap format is good until 2106 assuming the 1970 epoch. A bit of one of the now-unused header fields could be repurposed to indicate another.
In [1]: import datetime
In [2]: datetime.datetime.utcfromtimestamp(2**31)
Out[2]: datetime.datetime(2038, 1, 19, 3, 14, 8)