News for hackers. Stuff that matters.
Re:Glibc is still not Y2038 compliant by default by tgsovlerkhgsel on Wednesday December 29, 2021 @03:03AM (#29722893)
We're 16 years away from the overflow. In other words, some of the systems being put in production right now are going to be around, untouched, unchanged, when it happens.

Given this article, it seems we're still doing it wrong, and that means... 2038 will be "fun" (either the remediation, or the consequences of the lack thereof).

At least most of us in the industry now have a good retirement plan: Fixing the legacy systems in 16 years...

Re:Glibc is still not Y2038 compliant by default by Animats on Wednesday December 29, 2021 @03:17AM (#29722959)
We're 16 years away from the overflow. In other words, some of the systems being put in production right now are going to be around, untouched, unchanged, when it happens.

Yes. It's getting close. Windows XP, released in 2001, still had a significant presence in 2017, 16 years after introduction.[1] 42% of companies still had some XP systems running back then. 11% of machines were still running it.

[1] https://community.spiceworks.com/networking/articles/2719-wi...

Re:Glibc is still not Y2038 compliant by default by Beltiras on Wednesday December 29, 2021 @06:13AM (#29723836)
Thankfully upgrades move faster in the OSS world. The worrysome cases are embedded systems. Especially those built intentionally 32 bit.
Re:Glibc is still not Y2038 compliant by default by masklinn on Wednesday December 29, 2021 @07:05AM (#29724073)
...

TFA is about how GNU/Linux systems being deployed right now are not Y2038-safe.

Windows applications have been safe from this issue by default starting from VC8.0 (VS 2005), macOS users since 10.7.

And to be fair Linux itself has used 64b time_t on 64b machines from the start (and since 5.6 — last year — has also migrated i386 to 64b time_t[0], though a few issues will remain forever).

[0] https://lkml.org/lkml/2020/1/29/355?anz=web

Re:Glibc is still not Y2038 compliant by default by btown on Wednesday December 29, 2021 @09:41AM (#29725212)
> upgrades move faster in the OSS world

There are many who don’t think like this. Microsoft has dedicated teams that ensure backwards compatibility for legacy applications, and even then people stay on XP. If you have an inherited Ubuntu system that has been happily running a proprietary binary for years, there’s even less guarantee (and certainly no marketing organization making that guarantee) that an upgrade won’t break things. And so you fall far behind LTS.

Re:Glibc is still not Y2038 compliant by default by zymhan on Wednesday December 29, 2021 @12:29PM (#29727120)
laughs in debian

au contraire, it's quite easy to keep museum-level ancient Linux distros running

Re:Glibc is still not Y2038 compliant by default by azernik on Wednesday December 29, 2021 @02:43PM (#29729109)
Your desktop Linux distro is not the scary case here
Re:Glibc is still not Y2038 compliant by default by jandrese on Wednesday December 29, 2021 @03:10AM (#29722921)
Ironic that so many people are hoping to retire before they get asked to deal with this mess since so much medical equipment is built on ancient and poorly maintained microcontroller environments.
Re:Glibc is still not Y2038 compliant by default by treesknees on Wednesday December 29, 2021 @01:44PM (#29728238)
Which part is ironic?
Re:Glibc is still not Y2038 compliant by default by jandrese on Wednesday December 29, 2021 @01:52PM (#29728374)
The irony of retiring to avoid the problem only to have it become a problem with the equipment keeping you alive in retirement.
Re:Glibc is still not Y2038 compliant by default by cesarb on Wednesday December 29, 2021 @07:41AM (#29724282)
> In other words, some of the systems being put in production right now are going to be around, untouched, unchanged, when it happens.

Most of these systems being put in production right now will be using 64-bit distributions, which have always used 64-bit time_t. Most of the rest will be using embedded distributions, which often use something other than glibc. So only a fraction of these systems "being put in production right now [which] are going to be around" will be affected.

Re:Glibc is still not Y2038 compliant by default by xyzzy_plugh on Wednesday December 29, 2021 @07:45AM (#29724308)
This is false. Many, many embedded systems simply use glibc. I wouldn't go so far as to say "most" embedded systems do not use glibc.
Re:Glibc is still not Y2038 compliant by default by DiabloD3 on Wednesday December 29, 2021 @08:47AM (#29724735)
I don't know of any embedded systems still using glibc.

Dietlibc, uclibc (used by openwrt and the other consumer router replacement firmwares), musl libc, and bionic (since Android is technically an embedded Linux, so should be mentioned as well) dominate the embedded Linux space.

Re:Glibc is still not Y2038 compliant by default by Unklejoe on Wednesday December 29, 2021 @09:04AM (#29724866)
I do embedded development and I use Glibc on all of our products. It's as simple as checking the box in Buildroot, so why not? The version of Glibc I am using has special accelerated memcpy and string functions for my CPU (e6500 PPC, Altivec).
Re:Glibc is still not Y2038 compliant by default by ahartmetz on Wednesday December 29, 2021 @09:56AM (#29725316)
OpenEmbedded / Yocto / whatever (it's complicated) uses glibc, and that's a quite popular distribution construction kit.
Re:Glibc is still not Y2038 compliant by default by magicalhippo on Wednesday December 29, 2021 @11:55AM (#29726662)
I'm no expert, but at least STM32's default is newlib or newlib-nano, which it inherits from the ARM GCC toolchain[1] from what I gather. I just checked and here it's defined as the following by default:

    #define _TIME_T_ __int_least64_t   
    typedef _TIME_T_ time_t;

[1]: https://imagecraft.com/blog/2019/04/embedded-gcc-libraries-n...
Re:Glibc is still not Y2038 compliant by default by cozzyd on Wednesday December 29, 2021 @12:11PM (#29726872)
BeagleBoneBlack Debian:

ldd --version ldd (Debian GLIBC 2.28-10) 2.28 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper.

And of course, on actual microcontrollers newlib-nano is what you're likely using with a GNU toolchain.

Re:Glibc is still not Y2038 compliant by default by jcelerier on Wednesday December 29, 2021 @10:48AM (#29725831)
I don't remember ever being involved with embedded not using glibc if it was using any sort of Linux.
Re:Glibc is still not Y2038 compliant by default by champtar on Wednesday December 29, 2021 @10:54AM (#29725904)
OpenWrt uses musl for some years now.
Re:Glibc is still not Y2038 compliant by default by kevin_thibedeau on Wednesday December 29, 2021 @03:59AM (#29723156)
Things will start breaking in 2036 when NTP rolls over. Then everyone will wonder why they didn't have two years left.
Re:Glibc is still not Y2038 compliant by default by onei on Wednesday December 29, 2021 @04:33AM (#29723285)
I have no clue how widely implemented it is, but as far as NTP is concerned we're currently in era 0 which spans from 1900 to 2036. When we reach 2036, we just move to era 1 and have another 136 years until we reach era 2. NTP itself should be resilient to this kind of issue by design.
Re:Glibc is still not Y2038 compliant by default by dtech on Wednesday December 29, 2021 @06:13AM (#29723834)
We've seen time and time again that it doesn't matter what the spec says, if it works now, noncompliance will be there. Heck we're stuck with TCP & UDP because routers and firewalls will break anything else. If it works long enough, ossification makes it the new reality.

How many NTP implementations don't consider era or contain bugs if era != 0?

Re:Glibc is still not Y2038 compliant by default by fanf2 on Wednesday December 29, 2021 @07:11AM (#29724100)
There will almost certainly be failures in devices without battery-backed clocks (eg, Raspberry Pi) that boot in 1970 and rely on NTP to get the correct time, because NTP can’t tell them they are in Era 1 not Era 0.

To fix this you need a persistent low water mark on the time, compiled into the NTP program and/or stored in the filesystem (eg the timestamp on the NTP drift file). Then NTP timestamps can be interpreted as spanning the 136 years after the low water mark, using modular arithmetic.

Re:Glibc is still not Y2038 compliant by default by Unklejoe on Wednesday December 29, 2021 @09:07AM (#29724894)
> To fix this you need a persistent low water mark on the time

Yep, this is what many GPS receivers do to deal with the 20 year issue. They burn their manufacturing date, so they know which "cycle" they're in.

Re:Glibc is still not Y2038 compliant by default by asgeirn on Monday January 03, 2022 @05:09AM (#29779138)
From https://docs.ntpsec.org/latest/warp.html:

  > The NTP protocol will synchronize correctly, regardless of era, as long as the system clock is set initially within 68 years (a half-era) of the correct time
Which means 2036 will appear to work just fine, as 1970 is only 66 years away. Now jump forward to 2038, and this would not be the case..
Re:Glibc is still not Y2038 compliant by default by floatingatoll on Wednesday December 29, 2021 @06:08AM (#29723797)
Chances are, based on how poorly leap seconds and TLS 1.3 (and, I predict, http3/udp) are handled in actual reality by deployed systems, that a variety of software and hardware will fail inside infrastructure worldwide when ntp ticks over to era 2.

https://news.ycombinator.com/item?id=28046997

https://news.ycombinator.com/item?id=13750379

https://news.ycombinator.com/item?id=27402222

Re:Glibc is still not Y2038 compliant by default by Unklejoe on Wednesday December 29, 2021 @09:06AM (#29724881)
I've implemented the 1588 protocol a couple of times, and I have less optimism.

This "era" thing seems like the exact type of thing that someone would ignore when implementing the protocol, or if it is supported, probably doesn't get tested much. It's like leap seconds. Yeah, the leap second info is conveyed in PTP, but most of the implementations I've seen simply ignore it and just jam the clock when the time jumps.

Re:Glibc is still not Y2038 compliant by default by xattt on Wednesday December 29, 2021 @06:12AM (#29723822)
How many eras are possible in NTP?
Re:Glibc is still not Y2038 compliant by default by grogers on Wednesday December 29, 2021 @06:55AM (#29724028)
Infinitely many IIRC. Era isn't sent in the protocol, it's determined implicitly - if you know the time correctly to within a few dozen years you know the right era
Re:Glibc is still not Y2038 compliant by default by foxfluff on Wednesday December 29, 2021 @07:03AM (#29724063)
So a device made in 2021 whose (1970 based?) RTC battery drained has no idea which era it is in 2036. Perfect.
Re:Glibc is still not Y2038 compliant by default by Someone on Wednesday December 29, 2021 @08:22AM (#29724562)
A device made in 2021 could assume that the current time is at least 2021. Barring the invention of time travel and (a lot more risky) bugs assuming that NTP time stamps can be ordered by comparing them as 64-bit unsigned integers, that would make it OK for up to 2157 or so.

Working with that, conceptually, isn’t difficult. You can use any dateline as the epoch by subtracting the chosen epoch’s NTP timestamp from the one you received with wraparound.

Making a dateline library use that epoch for formatting dates and times isn’t hard, either, but could be a lot of work.

Re:Glibc is still not Y2038 compliant by default by foxfluff on Wednesday December 29, 2021 @08:52AM (#29724771)
Of course there are ways to make it work. I'm just assuming the vast majority of devs are not aware of this issue and mostly everyone's just solving their time problems by throwing NTP at it. Lots of things will break.
Re:Glibc is still not Y2038 compliant by default by ectopod on Wednesday December 29, 2021 @10:07AM (#29725411)
Absolutely. The only way we can be sure that this will be fixed by 2036 is by introducing a new NTP version that doesn't have this problem. Anything running the current version (which could be seen on the wire) would be considered broken.
Re:Glibc is still not Y2038 compliant by default by Someone on Wednesday December 29, 2021 @01:52PM (#29728373)
That version has been in development for some time (https://www.rfc-editor.org/info/rfc5905 is a proposed standard since June 2010)

https://en.wikipedia.org/wiki/Network_Time_Protocol#Timestam...:

NTPv4 introduces a 128-bit date format: 64 bits for the second and 64 bits for the fractional-second. The most-significant 32-bits of this format is the Era Number which resolves rollover ambiguity in most cases. According to Mills, "The 64-bit value for the fraction is enough to resolve the amount of time it takes a photon to pass an electron at the speed of light. The 64-bit second value is enough to provide unambiguous time representation until the universe goes dim."

Re:Glibc is still not Y2038 compliant by default by tgsovlerkhgsel on Sunday January 02, 2022 @03:27AM (#29766904)
Luckily remediating this is relatively easy: Use some indicator for "certified 2036 proof" NTP clients that's visible on the network (a different port, an extension, ...), then observe the network to find legacy traffic.

Won't catch absolutely everything (e.g. local containers), but will probably get pretty close. Especially if modern NTP client versions have some way to resolve the ambiguity, e.g. a hardcoded "it's after 2020".

Re:Glibc is still not Y2038 compliant by default by pdonis on Wednesday December 29, 2021 @11:06AM (#29726048)
> A device made in 2021 could assume that the current time is at least 2021.

As long as the device knows it was made in 2021. But the device can't know that by magic; the manufacturer has to store that information in it somehow. Do all device manufacturers do that?

Re:Glibc is still not Y2038 compliant by default by dathinab on Wednesday December 29, 2021 @11:54AM (#29726647)
The time library used could compiler in the time of compilation, in which case the library user doesn't have to do anything/get it for free.
Re:Glibc is still not Y2038 compliant by default by pdonis on Wednesday December 29, 2021 @03:00PM (#29729278)
Yes, that would work too.
Re:Glibc is still not Y2038 compliant by default by dathinab on Wednesday December 29, 2021 @11:50AM (#29726601)
Probably a bunch of devices will just jump to 1970 tbh.

Through if you do it properly you add some fixed known min . time (like manufacturing time, or time of the last system software/is update) and if the NTP time is noticable below the min time you increase the epoch by 1.

E.g. in you case the device could know it's revision had a min. time of idk. 2015. Then if it receives 1973 it knows it's 3 years in the next epoch.

But as anyone can guess there will be devices which didn't implement that at all and will end up in 1970. Or which require setting time by hand and will end up in 1970 because it truncates to 32bits at some point or similar.

Through some embedded devices might happen to avoid it. Like due to special reasons they might use a non-unix epoch.

Re:Glibc is still not Y2038 compliant by default by tyingq on Wednesday December 29, 2021 @10:07AM (#29725410)
RFC5905 uses 32 bits for era number and 32 bits for era offset in the 128 bit timestamp type. Though I don't think the 128 bit timestamp is used much...I can't find support for it in either ntpd or chrony.
Re:Glibc is still not Y2038 compliant by default by PixelOfDeath on Wednesday December 29, 2021 @06:10AM (#29723808)

  xfs filesystem being mounted at BLABLABLA supports timestamps until 2038 (0x7fffffff)
Hmmm...
Re:Glibc is still not Y2038 compliant by default by zaphirplane on Wednesday December 29, 2021 @04:30AM (#29723273)
Wouldn’t there be things that have future values set, like financial/insurance to name a few
Re:Glibc is still not Y2038 compliant by default by funcDropShadow on Wednesday December 29, 2021 @05:43AM (#29723656)
They and everybody else should avoid using timestamp representations for any dates so far in the future. Because, it is a nightmare to translate timestamps when the timezone database is updated. Which you would have to do, if e.g. the EU finally manages to get rid of summer time and you care that dates past that change stay the same.
Re:Glibc is still not Y2038 compliant by default by aulin on Wednesday December 29, 2021 @05:53AM (#29723713)
wait, why? unix timestamps are safe from this kind of mess as they are UTC seconds since the epoch, all the tz-aware conversion happens when you need to display localized dates but the timestamp you save should be as neutral and tz-unaware as possibile. I've seen way more bugs from people assuming system clock to be UTC while it was localized. Like missing and overwritten data on daylight saving changes.
Re:Glibc is still not Y2038 compliant by default by dtech on Wednesday December 29, 2021 @06:29AM (#29723920)
You lose context. Say you have 2100-01-01T10:00:00 in PST. That's 4102452000, so you store it.

A few decades later, timezones are changed. PST should add 30 minutes, all others stay the same. You only have 4102452000, what should you convert it into? You lost the time zone information, so you can't make the correct decision.

Re:Glibc is still not Y2038 compliant by default by 8organicbits on Wednesday December 29, 2021 @08:17AM (#29724517)
Changes to timezone changes can be quite abrupt too, this one was announced about 3 months before it took effect. Developers scramble to update software.

https://www.bbc.com/news/blogs-news-from-elsewhere-28423647

https://mm.icann.org/pipermail/tz/2014-July/021104.html

Re:Glibc is still not Y2038 compliant by default by aulin on Wednesday December 29, 2021 @06:45AM (#29723988)
if you need context, e.g. location, you can still save it in another field and you will be able to correctly display localized time at any point given the universal timestamp and the current location. Or you can save properly localized and tz-aware time, I just find timestamps safer from pitfalls.
Re:Glibc is still not Y2038 compliant by default by mlyle on Wednesday December 29, 2021 @01:23PM (#29727885)
> if you need context, e.g. location, you can still save it in another field

No. Say I have a database with a bunch of timestamps for future events. I calculate the time of those events with my current idea of local time (because my customer or because legal requirements require me to do something at a specific local time), convert to GMT, and store as a timestamp in my database.

In 2024, California decides to no longer observe Daylight Savings Time. All of those current timestamps no longer happen at the proper time in the newer version of America/Los_Angeles.

So there's a big pitfall here, in that the relation between localized time and UTC timestamp changes.

Re:Glibc is still not Y2038 compliant by default by aulin on Wednesday December 29, 2021 @02:10PM (#29728665)
Sure, you and others like you make pretty valid points. I believe we are talking about different use cases, hence the confusion. I was thinking of my most common use case of archiving events, usually experimental data, with a non ambiguous time reference.

If you need to schedule future events it gets obviously a lot more complicated, you don't need a timestamp you need local time and you need it to be robust to future changes in timezones, DSTs, politics.

Re:Glibc is still not Y2038 compliant by default by mlyle on Wednesday December 29, 2021 @02:29PM (#29728947)
Basically, it's important to recognize what you're actually measuring/capturing and store something maximally equivalent to that. Conversions may render figuring things out later impossible or very difficult.

If you care about a past moment in time as reported by GPS or a computer clock-- use a UTC timestamp.

If you care about a future time delineated by a precise interval from now-- use a UTC timestamp.

If you care about a future time expected to be delineated in a specific time zone, use a timestamp in local time and note the zone.

If you care about a future time in a customer's time zone no matter where they may be, store the time in an unspecified local time and the customer for whom the time applies. Etc.

Re:Glibc is still not Y2038 compliant by default by dtech on Wednesday December 29, 2021 @07:02AM (#29724060)
It's not about localization, it's about correctness. you need both the timestamp and tz if you care about the future local date and time.
Re:Glibc is still not Y2038 compliant by default by aastronaut on Wednesday December 29, 2021 @07:18AM (#29724143)
You seem to make a contradicting statement here with what you wrote in the sibling comment, no? timezone information are influenced by political means, whereas localization (lat/long) information is not. UTC timestamp + localization seem more correct to me.
Re:Glibc is still not Y2038 compliant by default by bdonlan on Wednesday December 29, 2021 @08:38AM (#29724677)
The semantics of "time X at point Y" are different from "time X in time zone Z". Sometimes the former may indeed be what you want, but it's uncommon for the user to be providing precise location information for a point in time far in the future. If you're told "time X, Eastern standard time", then the semantically correct thing to do is to not guess a point in space, but instead preserve the time zone as provided.
Re:Glibc is still not Y2038 compliant by default by ak217 on Wednesday December 29, 2021 @12:17PM (#29726950)
This line of thinking is how we end up with nonsensical UX like having to select "America/Los Angeles" to get US Pacific time. There are many use cases for datetimes and timezones, not all of them need a location and in some cases it's incorrect or misleading to include a location. You could certainly use a UTC timestamp and coordinates in your application but that doesn't work for many other use cases.
Re:Glibc is still not Y2038 compliant by default by oleganza on Monday January 03, 2022 @04:19AM (#29778853)
Your example is valid and replies are ill-informed. There is a difference between a "date" and "time interval". Timestamps are good for storing intervals, but if you need to plan something on a _date_, you need to store the date. This means you care not about specific number of seconds having passed since now, but about what calendar (and the clock) is saying when the event has to happen.

Example: nobody cares if a concert planned on November 19, 2024 at 19:00 in Honolulu starts in 12345600 seconds or 12349200 seconds since now. But everyone cares that everone's calendars and watches are in sync by that time and show specifically that date and that time, regardless of how many times people switched DST or timezones in the years in-between.

Re:Glibc is still not Y2038 compliant by default by osrec on Wednesday December 29, 2021 @06:48AM (#29724006)
Just store the time stamp and time zone separately and update the time stamp to reflect any changes to a time zone's offset (if that actually happens)...

It takes a bit of housekeeping, but isn't especially difficult.

Re:Glibc is still not Y2038 compliant by default by masklinn on Wednesday December 29, 2021 @07:20AM (#29724155)
> Just store the time stamp and time zone separately and update the time stamp to reflect any changes to a time zone's offset

Thus reinventing zoned datetimes badly

> if that actually happens

It happens literally all the time, sometimes with very little heads up e.g. the decision to apply DST or not can be take mere weeks before it actually occurs[0], and something as impactful as an entire calendar day disappearing can happen with 6 months notice[1].

[0] https://egyptindependent.com/egypts-hasty-goodbye-daylight-s..., https://codeofmatt.com/time-zone-chaos-inevitable-in-egypt/

[1] https://www.theguardian.com/world/2011/dec/30/samoa-loses-da...

Re:Glibc is still not Y2038 compliant by default by osrec on Wednesday December 29, 2021 @08:51AM (#29724761)
Thanks for this - I've learned something new today. I did not realise timezone updates were so frequent.

I do find that having the timestamp at hand makes math easier in a lot of the use cases I've come across. I wonder if there is an easy hybrid solution where you can capture timezone info, timestamp info and have it adjust without a full DB update, even if timezone offsets change. Maybe a mapping table of some kind, with versioned timezone codes.

Re:Glibc is still not Y2038 compliant by default by masklinn on Wednesday December 29, 2021 @08:56AM (#29724806)
Do note that this is an issue for future events.

For past events, you can store timestamps, it doesn't matter, the mapping is known and fixed.

Re:Glibc is still not Y2038 compliant by default by dtech on Wednesday December 29, 2021 @07:05AM (#29724076)
That works, but then you're working with timestamp+tz, not just timestamp. You lose a fair bit of the simplicity compared to e.g. ISO8601 strings.

> if that actually happens

The IANA time zone database [1] is updated several times a year, it happens all the time

[1] https://www.iana.org/time-zones

Re:Glibc is still not Y2038 compliant by default by aastronaut on Wednesday December 29, 2021 @06:59AM (#29724045)
As far as i'm aware, you should only store the location next to the timestamp and let the IANA[1] do the maintenance of the tz database. Please avoid the housekeeping on your side.

[1] https://www.iana.org/time-zones

Re:Glibc is still not Y2038 compliant by default by 3pt14159 on Wednesday December 29, 2021 @07:19AM (#29724148)
It actually is especially difficult at scale for non-trivial applications. Large databases won't be able to atomically change every instance which may lead to very frustrating bugs where collisions cannot be allowed. For example, on a calendar app. I agree with dtech, if you're storing in the future don't use a timestamp unless the input value is specifically intended to be timezone unaware, which is typically only useful for short term things like control systems or alarms. For longterm human uses a datetime+timezone field or an ISO datetime+timezone string is safer.
Re:Glibc is still not Y2038 compliant by default by dzdt on Wednesday December 29, 2021 @10:05AM (#29725392)
For many purposes the correct specification of a future time is in terms of local time at a particular location on that date. This is true for financial contracts (including trillions of dollars in options markets -- 10am in New York means NY time) but also of work schedules (scheduled to arrive at 9am? That is on the workplace clock, not UTC), local transit schedules, and many other things.

That means when daylight savings time rules change or timezone lines are moved the UTC time of these events change.

Unfortunately I don't believe anyone has standardized a format for storing times which are specified local time at a specified location on a specified date. So it is all roll-your-own or use UTC or zoned datetime and be burned when things change.

Re:Glibc is still not Y2038 compliant by default by davrosthedalek on Wednesday December 29, 2021 @06:23AM (#29723879)
The problem is that the contract normally doesn't specify epoch seconds. So if the translation of UTC since epoch to local time changes, the local time specified in the contract does not, so your UTC since epoch timestamp has to.
Re:Glibc is still not Y2038 compliant by default by CorrectHorseBat on Wednesday December 29, 2021 @06:20AM (#29723868)
I don't think so. Imagine you have date saved somewhere at 10am 1 July 2031. If the EU abolishes DST in between, do you want the hour changed to 9am or keep it at 10am? I'd say both could be correct.
Re:Glibc is still not Y2038 compliant by default by aulin on Wednesday December 29, 2021 @06:37AM (#29723951)
You convert it to the local time at that location at that point in history. That's something that belongs to time localization, timestamp should be universal and immutable against those changes.
Re:Glibc is still not Y2038 compliant by default by CorrectHorseBat on Wednesday December 29, 2021 @06:47AM (#29723999)
So I'd say you are arguing against using timestamp representations for any dates far in the future since they can change depending on what happens with timezones and DST, but timestamps cannot.
Re:Glibc is still not Y2038 compliant by default by aulin on Wednesday December 29, 2021 @07:06AM (#29724078)
My point is that either you save a properly localized tz-aware time in unambiguous standard format (iso 8601?) or you save a universal timestamp (and location if needed) and defer all the localization process to the moment you need to display localized time.

From my experience the latter is safer because people tend to save datetime strings in a format that's either not standard nor unambiguous.

Re:Glibc is still not Y2038 compliant by default by xxpor on Wednesday December 29, 2021 @07:37AM (#29724258)
I don't think you're answering the question here though. It's completely plausible there are situations where the contant is local time, not UTC (or TAI, if you want to get really obnoxious). Let's say I made an appointment to get my hair done in Berlin 10 years in advance, at 14:00 local time 29 Dec 2031, for whatever reason. Let's say someone goes crazy and moves Berlin to +1:30 this decade. I would still expect to show up at 14:00 local, but that's not the same universal time it was 10 years ago. How do you represent that in your DB where everything is in UTC?
Re:Glibc is still not Y2038 compliant by default by aastronaut on Wednesday December 29, 2021 @08:47AM (#29724733)
Frankly, time doesn't work that way... if i am atm (CET) and i make an appointment for sometime in summer 2022 (CEST), then i don't expect the hair salon to make the appointment in CET.
Re:Glibc is still not Y2038 compliant by default by xxpor on Friday December 31, 2021 @12:02PM (#29749916)
No, I think we agree. We're both making the appointment at whatever everyone in Berlin calls 14:00 on the day of the appointment.
Re:Glibc is still not Y2038 compliant by default by aulin on Wednesday December 29, 2021 @07:54AM (#29724362)
Honestly I'm not sure, in ten years Berlin timezone could not exist anymore, in your example you need a special time representation that says "this time in local time, whatever local time will mean in the future". I'm not sure we have that in current date time representation standards, do we? you could still save tz-unaware local time and a location, and figure out in the future what local time means at that point of time and space.
Re:Glibc is still not Y2038 compliant by default by Spooky23 on Wednesday December 29, 2021 @09:24AM (#29725029)
I’ve worked on systems where data has a 100-126 year retention objective. We had the “fun” of dealing with this looking backward as far as 1968!

When we reimplemented the system from an ancient mainframe, we stored the value as a Unix timestamp and a standard representation of local time. It was derived from an old format going backwards and recorded in the new format going forward.

Having both is critical for our successors to figure out wtf is going on. UTC 1/1/70 is an anchor point, and the local representation is canonical at a point in time. I don’t recall how 1968-1970 was handled. Not only do you have to plan for “Berlin time” going away, but for daylight (or double daylight) times changing. Having both entries allows you to reconcile, so the poor bastard figuring out what to purge in 2090 has a fighting chance!

Re:Glibc is still not Y2038 compliant by default by mindwok on Wednesday December 29, 2021 @05:49AM (#29723688)
What’s the alternative to a timestamp representation?
Re:Glibc is still not Y2038 compliant by default by wyufro on Wednesday December 29, 2021 @06:43AM (#29723978)
A string, ISO 8601, https://en.wikipedia.org/wiki/ISO_8601 Preferably RFC3339 (which is a specific profile of ISO 8601) but, as noted in a sibling comment, it isn't always appropriate for future dates.
Re:Glibc is still not Y2038 compliant by default by PeterisP on Wednesday December 29, 2021 @05:33PM (#29730979)
Finance/insurance generally sticks to dates instead of timestamps for most of its data, especially since the effective date might be different from the timestamp date (e.g. a weekend or night transaction having the value date for interest calculations set to the next business day; but you also might have backdated transactions caused by various corrections). Timestamps and timezones are used for logs and auditing, but for settling money it's generally considered that the thing that matters is at the granularity of a whole date.

Of course there are things like HFT where precise time matters a lot, but there you don't schedule things years in advance, all the long-term things like mortgage schedules and insurance terms simply ignore time and timezones.

Re:Glibc is still not Y2038 compliant by default by rst on Wednesday December 29, 2021 @09:28AM (#29725066)
There are also applications which might reasonably have to process dates 16 years in the future right now. I suspect most of finance, for instance, is on 64-bit systems at this point, or we'd be hearing a little bit more about this.
Re:Glibc is still not Y2038 compliant by default by dathinab on Wednesday December 29, 2021 @11:55AM (#29726668)
DateTime processing and system time are often handled separately with some system time to datetime time conversion.
Re:Glibc is still not Y2038 compliant by default by plank on Wednesday December 29, 2021 @08:03AM (#29724428)
Perhaps. But things like Log4j might help us: while in the previous century (2k problem) making a potential problem largely go completely away, it might be that in 10 years such an endeavor may be a simple task.