Happy 1600M epoch second
epochconverter.com
epochconverter.com
I use BitBar on my macbook to display the epoch second on my menu bar in a format like this: { 1,600,003,345 }
The script to do that is:
EPOCH=$(/bin/date +%s | /usr/local/bin/sed ':a;s/\B[0-9]\{3\}\>/,&/;ta')
echo "{" "${EPOCH}" "}"
Separating the epoch into thousands was done with the help of this Stackoverflow question: https://unix.stackexchange.com/questions/113795/add-thousand...EDIT: This is a much simpler way of writing it, thanks to GNU Coreutils' "numfmt"
EPOCH=$(/bin/date +%s | /usr/bin/numfmt --grouping)EPOCH=$(printf "%'d" $(date +%s))
Reproduced as text below:
$ date -u; date; date +%s
Sun Sep 13 12:26:39 UTC 2020
Sun Sep 13 17:56:39 IST 2020
1599999999
$ date -u; date; date +%s
Sun Sep 13 12:26:40 UTC 2020
Sun Sep 13 17:56:40 IST 2020
1600000000
An important point worth noting from the POSIX.1-2008 specification:"Coordinated Universal Time (UTC) includes leap seconds. However, in POSIX time (seconds since the Epoch), leap seconds are ignored (not applied) to provide an easy and compatible method of computing time differences. Broken-down POSIX time is therefore not necessarily UTC, despite its appearance."
See https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd... for more details on the above point.
By the way, in case you got curious like me to find out if this Hacker News story (the original post) was posted exactly at this time, the answer is, it was posted at Unix timestamp 1599999975. See https://hacker-news.firebaseio.com/v0/item/24460382.json for the details.
Over long periods of time the approximation that a day takes 86400 SI seconds will become less and less accurate as the rotational period of the Earth changes. I wish calendars would be either purely astronomical in nature or purely SI in nature. Hybrid systems like UTC become more and more messy over time as the amount of adjustment needed increases. We've had ~25 leap seconds in UTC already, and it's a relatively young calendar system.
EDIT: I also wish we would change the name of the SI measurement "second". An SI second and an astronomical second are two different things, and deserve two different names.
"For instances that can't/won't get updated in time, this Splunk app can be deployed as a workaround. The app executes bash/Powershell at Splunk startup to check for the above regex and add a '6' if needed. It may not be the best fix, but it does kick-the-can on the problem for another 3 years, at least until epoch time reaches 1.7e10."
Someone, somewhere is saying "but it passed all the unit tests..."
And to add insult to injury: that should actually be 1.7e9; 1.7e10 would be 17000M epoch seconds, not 1700M.
Funny how the comment says "replace this before 2017" oh well.
> The app executes bash/Powershell at Splunk startup to check for the above regex and add a '6' if needed. It may not be the best fix, but it does kick-the-can on the problem for another 3 years, at least until epoch time reaches 1.7e10.
So I don’t know if this is what actually happened, but this is a plausible reason for having such a regex that does not depend on stupidity: a “guess what this number could mean” routine written around 2015 might make include finding Unix timestamp-ish values not more than a few years into the future.
I’d still be pretty unhappy with the hard coded magic number approach and wish to see the specific requirements documented, along with some sort of tunable parameter for the range, as well as a test that verifies it works for the given requirements. Which gets into a fun and potentially philosophical exercise as well, since a test that passed yesterday should pass today, but this might be one case where “doesn’t fail with dates less than 5 years into the future” is a reasonable request.
It is an 'enterprise' log aggregator, storage system, and log search engine/alert generation engine.
One sets one's Java code (remember: "enterprise") to stream log output to splunk, and splunk handles receiving, storage, alert generation from programmed patterns matching, and archived log data search.
> It wouldn’t be too surprising to have a bunch of heuristics that try to extract meaning from unlabeled strings.
That is a very accurate description of just what it does.
on second thought, that's probably intentional to force their customers to upgrade at least once every 3 years.
Next one (1700M) will be on 2023-11-14 22:13:20 +0000 UTC.
* https://news.ycombinator.com/item?id=24459288
… or count actual seconds.
- A Deepness in the Sky, Vernor Vinge
Unfortunately, the bakery we got the cake from was unable to satisfy our request for 1000000000 candles on the cake.