• Malix@sopuli.xyz
    link
    fedilink
    arrow-up
    9
    ·
    3 months ago

    I’m ok with timezones, but the guy who invented daylight savings time I’d slap to all the way to the sun

    • northendtrooper@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      IIRC daylight savings was created way back when electricity really didn’t exist so it allowed the farmers more daylight to harvest their crops.

      Now with that said there is more technology in today’s farming equipment so DST shouldn’t really exist anymore.

      • snooggums@midwest.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        3 months ago

        So, this is wrong on so many levels. First of all, DST had nothing to do with farmers, it was to save energy usage in the summer as people were doing more things when the evenings were warmer.

        IIRC daylight savings was created way back when electricity really didn’t exist so it allowed the farmers more daylight to harvest their crops.

        DST does not increase the amount of daylight on any specific day of the year, it just shifts it later in the day so that people in 8-5 jobs can do more things after work. Farmers don’t work 8-5, they work as needed so if the crops need harvesting they will get harvested based on the weather.

        Now with that said there is more technology in today’s farming equipment so DST shouldn’t really exist anymore.

        Nowadays farmers have lots of lights and can harvest after the sun goes down, but that has nothing to do with why DST shouldn’t exist. DST shouldn’t exist because it doesn’t save energy due to any populated place having their lights on all night and the actual changing of time leading to negative outcomes like deaths from accidents with no benefits.

        Sure, the sun will come up earlier and set later in the summer if we get rid of DST, but the only reason for the time change in the first place was the standard working hours being longer after noon than before.

      • snooggums@midwest.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        3 months ago

        Which part of the year is DST and which part is Standard Time?

        I know, but it seems like half the people that say they prefer DST have it backwards.

        • scottywh@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          3 months ago

          It’s easy, the good part is DST (which is what we’re currently in - Spring through Fall in the northern hemisphere).

  • fubarx@lemmy.ml
    link
    fedilink
    arrow-up
    4
    ·
    3 months ago

    Worked on a project where devices just magically froze, but only during the month of February!

    Turned out the people who had written the firmware had decided to do their own time math to save space and had put in an exception in the code for leap year values. Except instead of February 29th, it kicked in for the whole month. And the math was wrong so you ended up with negative values.

    The product was due for launch in March of that year and was headed to manufacturing. It was by sheer luck that someone ran a test on February 1st and caught the problem.

    Don’t mess with time in code, kids.

      • fubarx@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        Embedded portable device with a teeny ARM processor. Sadly, no room for linux anything or even an RTC. Every time it connected to a phone, the phone would set its clock so the timestamps were somewhat close to being accurate.

        However, if you swapped out the AAA battery and DIDN’T connect it to the phone at least once, all your subsequent readings would go back to zero epoch and would be forgotten 🤷🏻‍♂️

        Good times.

        • AMDIsOurLord@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          3 months ago

          Some absolute and utter legend of a man made a Unix kernel for the fucking ZILOG Z80, you have no excuses

          (It’s called UZI and it’s written in K&R C for some obscure CP/M compiler)

          • fubarx@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            3 months ago

            If it had been up to me, I would have included a proper real-time-clock in the design and done things a lot differently.

            But the device was designed by one company and the BLE and processor module by another. For some ungodly reason neither trusted each other, so nobody was given access to the firmware source on either side. I worked for a third company that was their customer paying the bill. I was allowed to see the firmware for both sides, but only read only, on laptops provided by each company, one at a time, in a conference room with their own people watching everything. Yeah, it was strange.

            I was there because the MCU and the BLE processor sometimes glitched and introduced random noise. Turned out the connection between the two parts were unshielded UART with no error detection/correction 🤦🏻‍♂️

            It was concidental that we hit the date glitch. Took all our effort just to get them to add a checksum and retry. The tiny MCU was maxed out of space. No way to fit in any more code for date math.

      • dan@upvote.au
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        3 months ago

        Unix time.

        Unix time doesn’t help with timezones… It’s always in UTC.

        Unix timestamps also get a bit weird because of leap seconds. Unix timestamps have no support for leap seconds (the POSIX spec says a Unix day is always exactly 86400 seconds), so they’re usually implemented by repeating the same timestamp twice. This means that the timestamp is ambiguous for that repeated second - one timestamp actually refers to two different moments in time. To quote the example from Wikipedia:

        Unix time numbers are repeated in the second immediately following a positive leap second. The Unix time number 1483142400 is thus ambiguous: it can refer either to start of the leap second (2016-12-31 23:59:60) or the end of it, one second later (2017-01-01 00:00:00). In the theoretical case when a negative leap second occurs, no ambiguity is caused, but instead there is a range of Unix time numbers that do not refer to any point in UTC time at all.

        Some systems instead spread a positive leap second across the entire day (making each second a very very tiny bit longer) but technically this violates POSIX since it’s modifying the length of a second.

        Aren’t timestamps fun?

        Luckily, the standards body that deals with leap seconds has said they’ll be discontinued by 2035, so at least it’s one less thing that developers dealing with timestamps will have to worry about.

        Don’t try to write your own date/time code. Just don’t. Use something built by someone else.

        • Kairos@lemmy.today
          link
          fedilink
          arrow-up
          0
          ·
          edit-2
          3 months ago

          Unix time doesn’t help with timezones… It’s always in UTC.

          Unix timestamp is always in UTC which is why it’s helpful. It’s seconds since Jan 1st 1970 UTC. Libraries let you specify timezone usually if you need to convert from/to a human readable string.

          Don’t try to write your own date/time code. Just don’t. Use something built by someone else.

          …yes that’s why UNIX timestamps are helpful, because it’s a constant standard across all the libraries.

          Some systems instead spread a positive leap second across the entire day (making each second a very very tiny bit longer) but technically this violates POSIX since it’s modifying the length of a second.

          Then that system should be trashed.

          • dan@upvote.au
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            3 months ago

            Unix timestamp is always in UTC which is why it’s helpful.

            Any time you show the time to a user, you have to use a timezone. That’s why the unix timestamp has limited usefulness - it doesn’t do a lot on its own and practically all use cases for times require the timezone to be known (unless you’re dealing with a system that can both store and display dates in UTC). Even for things like “add one week to this timestamp”, you can’t do that without being timezone-aware, since it’s not always an exact number of seconds as you need to take Daylight Saving transitions and leap seconds into account.

            Then that system should be trashed.

            A lot of systems just don’t handle leap seconds well. Many years ago, Reddit was down for four hours because their systems couldn’t deal with leap seconds. Smearing the extra second across the whole day causes fewer issues as software doesn’t have to be built to handle an extra second in the day.

      • Fishbone@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        3 months ago

        too bad unix time only has 14 years of life left in it.

        Edit: this only applies to 32 bit Unix time. The 64 bit lifespan is a little longer, at 584 billion years. Whoops lol.

  • CanadaPlus@lemmy.sdf.org
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    3 months ago

    Cool, so sunrise is at 8 PM now. Or maybe there’s just no consistent relationship between what a clock on the East and West coast of America say, and a call can’t be scheduled between them.

    The real problem with time and date is that it has to fit social and natural systems as well as actual passage of time. A lot of nuance is unavoidable.

    • thanks_shakey_snake@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Yeah, tbh the “no timezones” approach comes with its own basket of problems that isn’t necessarily better than the “with timezones” basket. The system needed to find a balance between being useful locally, but intelligible across regions. Especially challenging before ubiquitous telecommunications

      Imagine having to rethink the social norms around time every time you travel or meet someone from far away. They say “Oh I work a 9-to-5 office job” and then you need to figure out where they live to understand what that means. Or a doctor writes a book where they recommend that you get to bed by 2:00PM every night, and then you need to figure out how to translate that to a time that makes sense for you.

      We’d invent and use informal timezones anyway, and then we’d be writing Javascript functions to translate “real” times to “colloquial” times, and that’s pretty close to just storing datetimes in UTC then translating them to a relevant timezone ad hoc, which is what we’re already doing.

      That’s what my rational programmer brain says. My emotional programmer brain is exactly this meme.

      • CanadaPlus@lemmy.sdf.org
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        My emotional brain thinks we should just give up and climb back into the trees.

        Funny enough, a story just broke about a lunar timezone, which would lose a second or so every year relative to Earth due to relativity. If space travel becomes a big thing we’re going to have to choose a frame of reference, and probably just go with Unix epoch in that frame as the universal time. Hopefully it doesn’t happen to pass through a black hole, because there’s no consistent way to define a frame of reference that’s not subject to gravity.

    • Muehe@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Cool, so sunrise is at 8 PM now.

      And the problem with that is… ?

      Or maybe there’s just no consistent relationship between what a clock on the East and West coast of America say, and a call can’t be scheduled between them.

      If you get rid of timezones they all say the same time, no? If you want to schedule a call you just say the time and save the timzone offset fiddling.

      The real problem with time and date is that it has to fit social and natural systems as well as actual passage of time.

      Can you give any more concrete examples? None come to mind beyond habit, which is not an immutable thing.

      • CanadaPlus@lemmy.sdf.org
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        3 months ago

        And the problem with that is… ?

        Subjective. It seems like it would be a bit confusing, though, if you had to relearn times whenever you travel somewhere (edit: and dates could flip over in the middle of a work day). But maybe you’d prefer that.

        If you get rid of timezones they all say the same time, no?

        Before they were invented, it was literally just anarchy. People set it to match people they knew. That’s what I was thinking of, but it could also just be one place where noon is at 12:00 PM.

        Can you give any more concrete examples? None come to mind beyond habit, which is not an immutable thing.

        Well, there’s not a round number of second in a day, or days in a year, for example, since they’re all naturally occurring and arbitrary. And then the Earth turns at a subtly non-constant rate, and people have settled on a seven day week. If you do have timezones, it doesn’t make sense to be inflexible with them when they run up against geography or trade and cultural ties, so they’ll be curvy, and geopolitics will itself change over decades and someone will want to change which one they’re in. All of this is a headache if you just want to do a calendar calculation.

        • Muehe@lemmy.ml
          link
          fedilink
          arrow-up
          1
          ·
          3 months ago

          It seems like it would be a bit confusing, though, if you had to relearn times whenever you travel somewhere (edit: and dates could flip over in the middle of a work day). But maybe you’d prefer that.

          I’d prefer that over having to change clocks when you travel, and having to have knowledge about the location and possibly having to flip the date when you encounter a reference to a specific time, yes.

          Before they were invented, it was literally just anarchy. People set it to match people they knew. That’s what I was thinking of, but it could also just be one place where noon is at 12:00 PM.

          Yes, you would obviously do the latter. No sense it going back to the bad old days.

          Well, there’s not a round number of second in a day, or days in a year, for example, since they’re all naturally occurring and arbitrary.

          Days in a year ok (except leap years). But seconds in a day are round (discounting days with leap seconds). 24 * 60 * 60 = 86400, which is divisible by two. Did you mean they are not based on the decimal system? I’d be up for a decimal based time system and a reorganised calendar, but that wasn’t the topic of discussion here.

          And then the Earth turns at a subtly non-constant rate, and people have settled on a seven day week.

          Yeah but none of that has much impact on the timezone debate.

          If you do have timezones, it doesn’t make sense to be inflexible with them when they run up against geography or trade and cultural ties, so they’ll be curvy, and geopolitics will itself change over decades and someone will want to change which one they’re in.

          Fair enough. I acknowledged this point in my other post, that there are historical reasons for timezones mostly rooted in administrative requirements. But I don’t think this is a good reason to not adopt a better system per se.

          All of this is a headache if you just want to do a calendar calculation.

          Exactly! So out with the old, in with the new. Sure this will create some other headaches, especially given how deeply rooted some of the relevant nomenclature is in most languages, but the sooner we change this the less it will hurt. I see that it might be a non-starter given the inertia and disunity of globalised society working against it, but it still seems desirable nonetheless, to me at least.

          • CanadaPlus@lemmy.sdf.org
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            3 months ago

            Days in a year ok (except leap years). But seconds in a day are round (discounting days with leap seconds). 24 * 60 * 60 = 86400, which is divisible by two. Did you mean they are not based on the decimal system? I’d be up for a decimal based time system and a reorganised calendar, but that wasn’t the topic of discussion here.

            Oops, I thought seconds were defined by the meter at some point. Nope, a pendulum 1/40000 of the distance from the pole to the equator just happens to measure the second near-perfectly, but the second stayed defined by astronomical motions until the atomic standard. Still, do to said variability of the Earth’s rotation since then it’s 86400.002, so even if it stopped changing we’d need leap seconds.

            The point being that even if you get rid of timezones the calendar will still suck to work with. I question whether we should even have fixed days, months and years, if the time doesn’t relate to the position of the sun in the sky. You might as well just go with Unix epoch, and leave days to be informal. Of course, then you’d have to calculate multiples of 86400 a lot to set appointments. Maybe we need a new decimal second as well.

  • technojamin@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    3 months ago

    I used to feel this way. Over the course of building out 2 calendar systems in my career (so far) and having to learn the intricacies of date and time-related data types and how they interact with time zones, I don’t have much disdain for time zones. I’d suggest for anyone who feels the same way as this meme read So You Want To Abolish Time Zones.

    Also, programmers tend to get frustrated with time zones when they run into bugs around time zone conversion. This is almost always due to the code being written in a way that disregards the existence of times zones until it’s needed and then tacks on the time zone handling as an afterthought.

    If any code that deals with time takes the full complexities of time zones into account from the get-go (which isn’t that hard to do), then it’s pretty straightforward to manage.

  • arc@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    3 months ago

    I once developed an electronic program guide for a cable TV company in New Zealand and I’d lose my mind if I had to use timezones. The basic rule of thumb was:

    a) Internally you use UTC religiously. UTC is the same everywhere on Earth, time always goes forward, most languages have classes that represent instants, durations etc. In addition you make damned sure your server time is correct and UTC.

    b) You only deal with timezones when presenting something to a user or taking input from a user

    Prior to that I had worked for a US trading company that set all their servers to EST and was receiving trades through the system which expressed time & date ambiguously. Just had to assume everywhere that EST was the default but it was just dumb programming and I bet to this day every piece of code they develop has time bugs.

    • letsgo@lemm.ee
      link
      fedilink
      arrow-up
      0
      ·
      3 months ago

      Standardising on EST is fine; it’s just UTC plus a constant. If they flipped between EST and EDT, now that’d be insane.