News for hackers. Stuff that matters.
Re:The Unix timestamp will begin with 16 this Sunday by dylan604 on Saturday September 12, 2020 @02:30PM (#24454379)
Isn't a second just how long light takes to travel 299,792,458 m?

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.

Re:The Unix timestamp will begin with 16 this Sunday by sltkr on Saturday September 12, 2020 @02:38PM (#24454423)
Yes, but the point is that the UNIX timestamp doesn't count the the number of seconds elapsed since January 1, 1970. It counts 86400 seconds per day, regardless of how many seconds the day actually has (which can vary due to leap seconds).
Re:The Unix timestamp will begin with 16 this Sunday by bitpow on Saturday September 12, 2020 @03:51PM (#24455032)
Is this accurate though? Isn’t the number of seconds since 1970 absolute, and it’s up to the library generating the Gregorian date to take into account leap seconds? I suppose if these libraries are not taking into account leap seconds, then the actual rollover will be a few seconds earlier (or later?) than what we think.
Re:The Unix timestamp will begin with 16 this Sunday by fanf2 on Saturday September 12, 2020 @04:28PM (#24455345)
See the definition of seconds since the epoch at https://pubs.opengroup.org/onlinepubs/9699919799.2018edition...

  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)*86400
Re:The Unix timestamp will begin with 16 this Sunday by JdeBP on Sunday September 13, 2020 @03:34AM (#24459134)
Your time_t isn't the true number of SI seconds since the Epoch. It's that number, mucked around 27 times so far. Instead of leaving their kernels to count one tick per SI second (ignoring oscillator drift) many people slew, step, or smear their seconds count every time that there is a leap second.

Go and read about "right" versus "posix" timezones.

* https://unix.stackexchange.com/a/294715/5132

Re:The Unix timestamp will begin with 16 this Sunday by Drdrdrq on Saturday September 12, 2020 @04:00PM (#24455117)
IIUC unix timestamp simply counts seconds (well defined interval of time) from epoch onwards. It is then up to different calendars to interpret this number as a given day / hour /... This is the beauty of it - it is always an accurate (well, at low speeds at least ;) ) measure of time. In other words, no, some days might not last 86400 seconds.
Re:The Unix timestamp will begin with 16 this Sunday by _-___________-_ on Sunday September 13, 2020 @12:44AM (#24458433)
This is not correct. UNIX timestamps always have 86400 seconds per day, and consequently, they do not actually count the number of seconds since the epoch.
Re:The Unix timestamp will begin with 16 this Sunday by Drdrdrq on Sunday September 13, 2020 @03:54PM (#24463461)
I stand corrected - thank you for the clarification!
Re:The Unix timestamp will begin with 16 this Sunday by TheArcane on Saturday September 12, 2020 @03:12PM (#24454717)
And meter itself is defined as the length of the path traveled by light in vacuum during a time interval of 1/299,792,458 of a second.

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

Re:The Unix timestamp will begin with 16 this Sunday by jiofih on Saturday September 12, 2020 @03:30PM (#24454858)
> Since 1967, the second has been defined as exactly "the duration of 9,192,631,770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium-133 atom

> 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

Re:The Unix timestamp will begin with 16 this Sunday by ztjio on Saturday September 12, 2020 @03:21PM (#24454791)
No. A second is "The duration of 9192631770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium-133 atom."
Re:The Unix timestamp will begin with 16 this Sunday by stan_rogers on Saturday September 12, 2020 @03:21PM (#24454789)
No, that's how the metre is defined. The second is defined by the transition between two hyperfine states of cesium 133 (9,192,631,770 'oscillations').