Leap seconds still make time go forwards, not backwards. NTP clients would also resolve small time discrepancies while still advancing forwards prior to the next time sync.
Leap seconds still make time go forwards, not backwards. NTP clients would also resolve small time discrepancies while still advancing forwards prior to the next time sync.
I didn’t say Unix time, I said UTC. And no it won’t report negative time, not unless somehow the system clock was modified while it was running…
UTC always goes forward regardless of the timezone and local time. That is why you should use it. To take my EPG situation above, I stored program start / end times in UTC so they would render properly even if DST kicked in or not during the middle of the program.
Yes as long as the rules are known, but it’s really just better to do things sanely and leave no margin of doubt.
True but so do most computers. Computers have a database of timezones and time offsets around the world. Depending on the UTC date and time, and your current timezone it will look up what offset to apply to show the local time. The database is very gnarly since rules change over time, e.g. maybe in the 70s some countries had longer DST to counteract oil shortages.
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.
Predominantly C. But even the kernel is beginning to use Rust as a way of avoiding entire classes of programming error.
The only reason people use JS is because it’s the defacto language of browsers. As a language it’s dogshit filled with all kinds of unpleasant traps.
Here is a fun one I discovered the other day:
new Date('2022-10-9').toUTCString() === 'Sat, 08 Oct 2022 23:00:00 GMT'
new Date('2022-10-09').toUTCString() === 'Sun, 09 Oct 2022 00:00:00 GMT'
So padding a day of the month with a 0 or not changes the result by 1 hour. Every browser does the same so I assume this is a legacy thing. It’s supposed to be padded but any sane language would throw an exception if it was malformed. Not JavaScript.
Lemmy is written in Rust. There might be bits of C at the periphery behind bindings.
The problem is, that most languages have no native support other than 32 or 64 bit floats and some representations on the wire don’t either. And most underlying processors don’t have arbitrary precision support either.
So either you choose speed and sacrifice precision, or you choose precision and sacrifice speed. The architecture might not support arbitrary precision but most languages have a bignum/bigdecimal library that will do it more slowly. It might be necessary to marshal or store those values in databases or over the wire in whatever hacky way necessary (e.g. encapsulating values in a string).
Norway has life sentences that mean 21 years. they might hold him indefinitely with extensions while he is a danger to society. But this POS could become enfeebled, or sick, or feign remorse in which case he might get released. I expect his freedom will be very brief and painful however.
I suspect Breivik would have been allowed to meet more people, and increased interactions with other prisoners if he showed any kind of remorse or repentance for his crimes. But since he doesn’t, and uses these lawsuits to advance his cause, it’s no wonder that Norwegian authorities have chosen to limit his interactions to the absolute legal minimum because screw him.
Sadly for him he committed his crimes in a country without the death penalty. So he gets everything the state can throw at him for the rest of his life. I still think that a regular life prisoner in a US prison would envy his treatment compared to theirs.
Exactly. As soon as his whereabouts were known he’d be the target of everyone. Not just political groups, but just normal people on the street. If he’s lucky they’ll just spit in his face. If he’s not he’ll get beaten up or worse.
It’ll be interesting to see what happens if he’s ever released but I don’t think he’ll be enjoying his freedom for very long.
Breivik is the sort of murderer, where there is absolutely zero doubt about his guilt, where the crimes themselves are heinous, and where he should never see the outside of a jail cell ever. If Norway had voted to throw him down a mineshaft, or imprison him in a windowless cell where he was fed slops for the rest of his life I couldn’t care less.
But Norway isn’t like that and he is being treated exceptionally well by any standard for his category of offence. His pathetic narcissistic legal whining to the courts will go nowhere and he’ll stew in prison for as long as they can legally hold him. I think authorities would be relieved if he made good on his threats since it spares them the concern of what happens if he is eventually released.
Well obviously it was a failure and always was going to be a failure. Whereas before there was frictionless trade, travel, employment, living, there is now an ever expanding wall of bullshit and red tape. Getting goods to and from Europe is subject to import duties and delays that just kills trade - why would a Spanish company buy widgets from the UK when a supplier in Germany can supply them faster and reliably without any customs redtape?
It will take the UK years to form other trade deals, none of which will be remotely as favourable as they would get with negotiating power of the entire EU behind them. There have already been noises in the UK press about having to take food from the US which would fail EU standards - bleached chicken, GM crops, growth hormones etc. And that’s because when the US comes to the negotiating table they’re going to bend the UK over and screw them. And China, India and the rest of the world will be lining up for some sloppy seconds.
I live in Ireland and litter is a major issue. Bottles, cans, cups, discarded food, trash dumped in country lanes and worst of all fly tipping. I think a lot of these issues are easy to remedy and while reusable coffee cups are a positive there is a lot more that could be done.
Hamas are absolutely headbanging murderous zealots committing a lot of atrocities right now. But if you herd people up, deprive them of basic liberties, brutalize & kill a bunch of them, and steal their land at gunpoint and then you can hardly act all shocked that a bunch of them are radicalized and go on a rampage. Doesn’t matter if we’re talking what Israel has done to Palestinians or what the United States did to Native Americans. Maybe the lesson to learn here, is don’t do those things. But I expect that Israel will pound Gaza committing its own atrocities as payback and the same thing will happen again in another decade.
It doesn’t work like that. UTC goes forward always. Leap seconds are scheduled and known in advance. NTP time services will just smear time advancement a little to account for an additional second. Time never has to go backwards. This is how Google does it.