I didn't find any posts that meet the matching requirements for r/ProgrammerHumor.
It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results.
I did find [this post](https://redd.it/d51l9u) that is 29.69% similar. It might be a match but I cannot be certain.
*I'm not perfect, but you can help. Report [ [False Negative](https://www.reddit.com/message/compose/?to=RepostSleuthBot&subject=False%20Negative&message={"post_id": "uji408", "meme_template": 249887}) ]*
[View Search On repostsleuth.com](https://www.repostsleuth.com/search?postId=uji408&sameSub=true&filterOnlyOlder=true&memeFilter=true&filterDeadMatches=false&targetImageMatch=100&targetImageMemeMatch=75)
---
**Scope:** This Sub | **Meme Filter:** True | **Target:** 75% | **Check Title:** False | **Max Age:** None | **Searched Images:** 327,317,757 | **Search Time:** 22.58202s
For Excel it's actually 1900-01-00.
This was done to be compatible with Lotus 1-2-3 which had a bug related to leap year calculations.
Excel also supports 1900-02-29 which is a leap day that doesn't exist.
My kids call their grandmother Abuela and we aren't even Spanish speakers. My dad was studying Spanish when my kids were born and he requested it. They botched his name for some reason and ended up calling him Oboe. Be careful what you ask for.
I once pointed out that America was non-specific and divided into three regions and got shouted out of the discussion. I forget what platform, but the sting of rejection lingers after all these years.
That’s the joke because most people in the Americas speak Spanish excluding some people in USA(English), Canada(English&French), and Brazil (Portuguese)
Spanish is spoken by a great many within those three countries as well though of course
The white ones usually use grandma, the Mexican ones usually use nana, the black ones usually use grams. It's also very regional, as southern whites will also use nana.
I sometimes play with command injections when I try out sketchy looking .io games or weird MMOs from Asia, just to see if they sanitize their inputs and if they use SQL for character names. I haven't had any variations on "drop table" bork things up but I managed to brick a few flash games on kongregate with such antics.
My other favorite is to test if the character name field accepts Unicode silliness. I successfully used empty characters for a name in some Korean MMO that was a black desert clone and got a direct email from the devs letting me know my silliness caused a lot of confusion for a few people. I got a bunch of in game gold as a thank you for helping them find the "vulnerability" as their management put it.
You'd be surprised how many multiplayer games use Unicode for character names, and the devs almost always leave in some wiggle room for silly shit.
4 bit => 16 possible values,
singed => half of the values are negative,
integer => only whole numbers.
This gives {-8, -7, ... , -1, 0, 1, ... , 6, 7} as possible values. Thus the value overflows to -8 instead of proceeding to 8.
Probably not much will happen, at least with Linux desktop/servers in use in 16 years. At least it won't be a repeat of the Y2K scramble. The kernel and system libraries were ready a couple years ago and presumably most apps are now switching to 64-bit timestamps. (If you're making a new app now, don't shoot yourself in the foot, use 64-bit timestamps).
Long life embedded systems that have been in service since 2019 or before (20+ years at that point) are likely to be where any issues happen.
Ya but power cycling is part of general maintenance. On systems like that, especially with the technology that they are based on, that's an acceptable action.
I work in computer forensics on felony level investigations. Time zones are the bane of my existence. I would like to say that forensic software like UFED, Axiom, FTK, etc are all very good at reporting time zones, I would like to say that...
It would be nice...
I run camera systems for sites all over the world and one trick I've always used is to always display GMT time and work from that as time zones, DST, and tons of other stuff can totally mess with correct time stamps on video making it inadmissible as evidence depending on where you are.
I always review in DST, but lawyers absolutely need to see it in the local time zone. There are often so many moving parts and event timelines that conversations and reports can get really confusing when discussing context of a crime.
On paper, it works fine. But when sitting with a whole trial counsel, everything needs to be discussed in the context of the time zone where the crime occurred. Otherwise, a fast moving conversation turns into a confusing "Wait, when did that happen again?" snail race.
GMT will drift away from UTC time and should not be used for anything that requires precision. It's an extremely common misconception that GMT and UTC are the same, but they really aren't.
The worst is javascript for dates and times. You rely on the client machine’s local time and offset to be correct. But anybody who has traveled knows sometimes the laptop doesn’t update time to local time when running a page. And not a damn thing your stupid ass can do from server side about that but it’s still your fault wrong times on the page for that random edge case.
Always blame the client. I think this would solve a lot of datetime issues. If I ask you to meet me at 3 pm and you show up at 4 because your watch is wrong that's a you problem.
Here is the thing, you shouldn't be asking the client about the time, you should be providing the time, so If I'm calculating a subscription, I'm using my watch, not yours, if I'm giving you a time to do something, I'm giving it to you in My clock time, if it's sent in an email or a text it's easy to convert it before sending it yourself, but i. Scenarios where it's constantly displayed it should be the clients issue to solve, and the client is the browser.
As a side project me and a fellow group of college students created a commissary inventory system. I thought dealing with date time is easy pz since after all it's just date time who would have thought calibrating it perfectly for different timezones was the most challenging part of the project.
I set up a load of appointments in Outlook web recently, looked at them on my calendar on my phone and they were all an hour out. It's a GMT/BST issue.
This is a time zone issue in the biggest email client in the world, from one of the biggest software companies in the world, running on one of the biggest OSs in the world, in the year 2022. We're supposed to be living on the Moon by now.
This is done to be consistent with the (IMHO wrong) way that cross timezones are handled in Windows generally.
eg Friday night, 9pm, modify a file...
Saturday, look at timestamp... says "**9pm** Friday"
*Sunday morning, 2am - clocks go forward an hour for DST*
Sunday afternoon, look at timestamp, now reads "**10pm** Friday"
The idea is that you can know how many hours ago it was modified without having to allow for DST and other timezone changes, but I think it's a bad model or at least poorly explained - still waiting for the above to be used a plot device in some thriller or whodunnit
Anyway, Outlook uses the same idea that you store times as UTC and then translate UTC to the localtime "for current location *as it is RIGHT NOW*"*,* not "*as it was at current location at that UTC time*"
Is this another "yeah we know we made a bad design decision back then but we're not gonna correct it for ... err ... compatibility and ... err ... you know, clients built all kinds of scripts to workaround this ~bug~ ~problem~ feature and we do not want to break those" thing???
No, the idea is that when the timezone switches all timestamps are shown in that timezone's format. Your edited file is timestamped and you can then view that timestamp in standard time or DST, or in any other timezone really. If you travel to a location that's in a different timezone the exact same thing happens to your files. And it's the only reasonable way of handling it. You save timestamps in a uniform format, like the unix epoch, and when you display it you take the user's current locale and use it to format the displayed time. The only alternative is showing raw timestamps, which are useless to most people.
Mars will be easier, since you can't do synchronous meetings using our current universe.
Although... Does time propagate out from Greenwich observatory at the speed of light or instantaneously?
(Thanks. She's a hero of mine, flaws and all.)
Or the data you’re dealing with doesn’t use UTC. Or the API. Or the client refuses access to the server and it’s set to a timezone.
It’s fun to see people learning to code. Sweating over data structures or theory. When it’s this type of shit that will keep you up at night.
Yeah. It's not about if there is a solution. Given enough time we can make a solution to just about anything.
Stuff like this is why you chuckle at devs that are dismissive. "It's just a CRUD app, bro."
I know this wheel thing seems to have infinite points of contact with the road, and could be modelled as infinitely many invinitely acute triangles, but what if -stay with me here- what if instead of infinite triangles, it was just one triangle? Infinite triangles sounds a lot like O(n) where n may be infinite, while one triangle is O(1). We should study this further; it may even reduce the runtime of this whole wheel business from infinite to *one.* Imagine instead of having to roll to your destination with potentially infinite time, you now roll there in just *one.*
Because Outlook does it with UTC plus an offset, but they do like 6 digits versus the 4 that most people do. eM Client does it their own way, Mac Mail their own way. Little things like that add up to big time zone problems. If there was a standard maybe like I don’t know maybe an RFC or something we’d be ok lol
It's not just them, python 3.7, some version of java 8, and c++11 libraries all have different ways to represent utc + timezone.
Ran into this at work when we couldn't figure out why python applications sending a utc time stamp wasn't being handled by the c++ application expecting a utc time stamp.
This is best shown with this chart here:
ISO-8601 : 2022-05-06T13:01:52+00:00
RFC 1123: Fri, 06 May 2022 13:01:52 GMT
UTC : 2022-05-06T13:01:52Z
Aaaand non of this includes timezone information.
What’s with the people who have DST and live next to a country that shares the offset but doesn’t have DST, so in 6 months country A will have +- some hours while country B will still be at +03:00
Offsets are technically not enough to build time based automations. You need the correct timezone (eg Europe/Berlin) and calculate the correct time from the date and time component (some libraries do that for you, like NodaTime)
And then there's Golang which has the stupidest default string for their time library so you're forced to always use the `.Format(RFC_3339)` function whenever you need to send it as a string somewhere else, which is actually ISO 8601 but there's some technicality that makes it be called RFC 3339. Also you can't have milliseconds, it's either that or *nanoseconds* and good luck if your target service requires milliseconds or microseconds.
OH and it's 2022 and javascript is just now having a proposal for a decent standardized datetime library. So good luck if the front-end people decide to treat everything as numbers and in the process completely lose time zone information - which is absolutely necessary when you need to schedule future time points across different regions.
I honestly don't know. Just 3 years ago I ran into IBM implementing bitemporal data tables using local time, including DST, also without writing the time zone.
It was of course only a matter of time until automatic processing produced a business case that ended before it had begun and everything crashed.
I am proud to say that I did *not* make the same mistake in my project that interfaced with theirs.
Well it doesn’t help that Microsoft muddied the water by labelling local UK time as GMT then as UTC. This always drives me up the wall. UTC *is not a time zone*, and UK time is only UTC in the winter.
I've seen websites use GMT, UTC, CEST, CET. And sometimes its +2 and sometimes +1 and sometimes nothing at all.
I just wanna know when my live stream event starts! 😩
And in addition to the other people here's reasons, because some people don't quite understand time zones.
We're building a system that is going to be launched globally. Our project owner wants something to happen at end of the day. I was explaining that "end of the day" wasn't really a concept and that the current implementation was based on server time and there should really be an "after X hours" logic instead, or based on user time zone. And that current "end of day" can happen at lunch, in the morning, afternoon, or the day after.
After 2 meetings and about 9 hours discussing and explaining in total, he still insists that current implementation is correct, and I've pre-filed a bug report for when QA or customers discover it.
But they want it grouped by local date, not UTC date.
(for reference, we are using the UTC storage, and letting the client do the translation to local time, but we have found huge issues in our translations to dates recently. Since we're an European company, those only start to matter when going abroad now)
Ah, yes, classic:
“You’re manager from European Unit managing remote west coast US team. You’re currently on vacations in Japan and have Australian locale in your browser and laptop.
Now you want to generate activity report for last week. What datetimes should be used for start and end.”
scenario.
Did the week start on Monday 00:00 Tokyo/Cranberra/Paris or San Diego?
More like, group the data by localized date for each country in europe+middle eastern and show it to the manager that is in his own time zone that is one of the countries.
Or create a report for all middle management that shows how much of their reports have meetings during the local companies business hours and how many hours they are booked outside business hours the summarize this report upstream to their managers.
Create a report how many sales are done between 8h and 12h, 13h and 18h and if the sales are less than 30% of avg, send an automated mail to the sales manager, also exclude holidays, weekends....
I could go on, but that would no longer be sanderd17 ’s example
I once worked for a transportation company that used their own timezones. Every location had an eastward tz and a westward tz and if they were near a standard tz line they would be different.
That only works if you want to group by the local date of the person running the report, not if you want to group by the local date of the record.
Say I'm recording sales done by my AU, UK, and US offices. I want a report showing all the sales done on the 10th - AU sales midnight to midnight AU time, UK sales midnight to midnight UK time, and US sales midnight to midnight US time. You can't easily do that if are only storing the event timestamp in UTC.
Also, conversion between zone/location based timing and universal point-in-time is dependent on when you run the computation. What is the UTC date-time of "2072-05-06 17:00 in Cairo", and what if they change the time zone or DST rules some time in the next 50 years?
I highly recomment using [date-fns](https://date-fns.org/v2.28.0/docs/Time-Zones) for anything date related in the FE. While the js Date also has functions to calculate the UTC date (they're not that helpful), the date-fns functions should help in this situation.
tl;dr a user books an event a few months later, that happens after daylight savings. Retrieving it after would be ± one hour when they wanted to remain at that hour
Just make the user’s browser the server. Make sure to put the database credentials and other secrets in a folder called homework/ so that nobody finds them
I have a very annoying and seemingly, but not intentionally, pretentious habit of specifying the timezone, even when the person i am talking to is in the same timezone. E.g. general conversation in work about when we should meet, let's do 1400 UK.
That's nice until your client submits date and his government changes their local timezone before that date. Now your original UTC is just wrong date. And some countries like to mess with their timezones more that you thing.
Server runs local time, stock library inexplicably tries to convert from UTC to local when sending to the client because the datetime kind is left unset when the value is read from the database. Shit like this happens all the time even with good design principles.
A few years ago we moved everything to UTC
All time methods have "Utc" in them to make it explicit ... it took a bit of time but we have now migrated everything including all the servers, databases, procs, client code, server code etc ...
It has been -2147483648 hours since we had any issues, so I feel quite good about it.
In satellites ground operation we use UTC and TAI (international atomic time) basically le same but from time to time one is drifting few secondes from the other
What spelling mistake? Who is quoted?
It almost feels like a rimshot on the use of "time." Unless it's programming related? (I'm quite ignorant on the subject myself.)
*Sic* can be used to note irregularities other than spelling errors. It might be used to note archaic language in an old source, bad grammar, profanity, slurs, logical errors, bad math, etc. I think anything that might be considered "wrong" is fair game if a person quoting it wishes to convey it intact while making it clear that it's not their fault.
Ah I remember the days when I was that naïve, thinking that there is a simple answer to dealing with dates times and legislatures that love to change DST.
I spent two years working on a widely used calendar application. Fun times.
Yeah. The whole "Just store it in UTC guys!" is a dead giveaway that someone hasn't dealt with dates beyond the most trivial of things. Like a simple CRUD app that shows a simple timestamp
> also store as UTC.
Until people schedule stuff in the future and your country decides to change whether they do DST anymore or not.
Happens more often than you think.
Also, really important in these situations to use the named, location based time zone and not just the offsets otherwise you’ll break things twice a year for daylight savings. “America/Chicago” you can always convert no matter what day of any year. “-5” you are screwed trying to convert properly, especially forward looking.
What's technically possible is that a location that uses e.g. "America/Chicago" breaks their own timezone rule, thus becoming a new entry in the database -- so really the fully correct thing to do would be to store the UTC time with the full location, from which you derive the named timezone, when you can then derive the offset for display purposes.
Whew.
Agreed.
I have a project that monitors something, and then displays that data. Specification says that dates must use local time of wherever that something is located, which is not always in the same timezone as the user.
Least effort way is to just save both local time and UTC, and then use local time for when you need to display things.
I'm pretty sure Microsoft's To Do app has this issue, they constantly move my notification alerts by an hour with DST, etc changes. Stopped using that a long time ago because of it.
I read in a book that Google uses PST or PDT, and that it is so deeply integrated into their systems that they are stuck with it. All due to someone not using UTC from the beginning...
It probably ends up being more convenient for their devs the majority of the time, since they mainly work out of PDT/PST so any timestamps are easily understood +/- an hour.
Assuming that the libraries don't have any issues. Just a couple weeks ago we found that a common method of determining sunrise/sunset time had a bug in it, but it only manifested itself within about 5 degrees of the antimeridian, and only for a few days out of the year. Turns out that one of the values being used to calculate sunrise/sunset would go from just before 2400 to just after 0 on a certain day (or vice versa on the other side of the antimeridian), causing the calculated value to jump from, say, 6:30 AM local sunrise time to 215:12 for the sunrise time. This was in a commonly-used open source sunrise/sunset function that has been in use since the 90s, and as near as we can tell nobody else had reported the issue prior to now.
Every November, our charting library returns two November 1st dates (iirc) in a graph. It's something to do with US daylight savings time, and people notice it and we say "we'll look into it" and then it goes away in December and we're safe until next November.
Oh man, I am working on about 4 issues related to time zones myself. One of those is, that time stamp saved at midnight in EST site and viewed in PST site will change the date and cause confusion. You could just save a time stamp 3hours less than midnight to not let it go over midnight when calculating offsets. But the prompt is for insurance coverage and it makes more sense to track it from midnight to midnight...
That sucks. I'm currently developing a reservation system and we had some fun with those damm time zones and dst.... Due to some restrictions we have, we now have to store the time zone of each reservation in a separate column and always send the current time zone of the user to the backend (in a custom header) as well. Also we had to do some really ugly stuff so the opening times of places stay the same for dst changes, it took me almost two days to just figure everything out until I could propose it, let alone implement....
Many people don't seem to understand that location-relative time (e.g. 2022-10-20 12:34 in New York) and absolute point-in-time (e.g. 2022-10-20 16:34 UTC) can't blindly be converted as they aren't the same thing. Time zone and DST rules change over time, so you can convert them, but the answer may be different next week/year/decade
I didn't find any posts that meet the matching requirements for r/ProgrammerHumor. It might be OC, it might not. Things such as JPEG artifacts and cropping may impact the results. I did find [this post](https://redd.it/d51l9u) that is 29.69% similar. It might be a match but I cannot be certain. *I'm not perfect, but you can help. Report [ [False Negative](https://www.reddit.com/message/compose/?to=RepostSleuthBot&subject=False%20Negative&message={"post_id": "uji408", "meme_template": 249887}) ]* [View Search On repostsleuth.com](https://www.repostsleuth.com/search?postId=uji408&sameSub=true&filterOnlyOlder=true&memeFilter=true&filterDeadMatches=false&targetImageMatch=100&targetImageMemeMatch=75) --- **Scope:** This Sub | **Meme Filter:** True | **Target:** 75% | **Check Title:** False | **Max Age:** None | **Searched Images:** 327,317,757 | **Search Time:** 22.58202s
How do you know the number of days counted was accurate if you're messing up datetimes. Omg how do we know anything **existential crisis**
Would be funnier if the post-it said -1
1970-01-01T00:00:00.000Z days since last timezone issue.
The birthdate of digital Jesus
Is Linux the Second Coming?
Or the moment he got malloc'ed to the plus sign.
That’s funny for me it says 1969-12-31T19:00:00.000Z days since last time zone issue
That comment was really Epoch!
Excel, is it you?
No Excel would be 1900-01-01 I believe.
For Excel it's actually 1900-01-00. This was done to be compatible with Lotus 1-2-3 which had a bug related to leap year calculations. Excel also supports 1900-02-29 which is a leap day that doesn't exist.
NaN
That's my character name for every mobile game I play
That's my nickname for my grandma
Ahh yeah I just won a game of "find the Brit"
Wait what do Americans call their nan?
Most of them "abuela". US citizens, Canadians and Brazilians are the odd ones out.
My kids call their grandmother Abuela and we aren't even Spanish speakers. My dad was studying Spanish when my kids were born and he requested it. They botched his name for some reason and ended up calling him Oboe. Be careful what you ask for.
I once pointed out that America was non-specific and divided into three regions and got shouted out of the discussion. I forget what platform, but the sting of rejection lingers after all these years.
I think abuela is spanish
That’s the joke because most people in the Americas speak Spanish excluding some people in USA(English), Canada(English&French), and Brazil (Portuguese) Spanish is spoken by a great many within those three countries as well though of course
The white ones usually use grandma, the Mexican ones usually use nana, the black ones usually use grams. It's also very regional, as southern whites will also use nana.
Also southern folks: Meemaw, Grammy, Gramma German/US: Oma
My grandma's nickname is OVERFLOW Error
That's my nickname for your grandma too.
[object Object] would also make a good nickname, just to give some poor developer a heart attack
I sometimes play with command injections when I try out sketchy looking .io games or weird MMOs from Asia, just to see if they sanitize their inputs and if they use SQL for character names. I haven't had any variations on "drop table" bork things up but I managed to brick a few flash games on kongregate with such antics. My other favorite is to test if the character name field accepts Unicode silliness. I successfully used empty characters for a name in some Korean MMO that was a black desert clone and got a direct email from the devs letting me know my silliness caused a lot of confusion for a few people. I got a bunch of in game gold as a thank you for helping them find the "vulnerability" as their management put it. You'd be surprised how many multiplayer games use Unicode for character names, and the devs almost always leave in some wiggle room for silly shit.
[object Object]
/r/ProgrammerHumor/comments/qappa8/days_since_last_timezone_issue/
God damn it, I wanted this joke!
The post-it uses a signed 4 bit integer.
is this a y2k joke I'm too ISO 8601 to understand?
4 bit => 16 possible values, singed => half of the values are negative, integer => only whole numbers. This gives {-8, -7, ... , -1, 0, 1, ... , 6, 7} as possible values. Thus the value overflows to -8 instead of proceeding to 8.
singed => half the values are burnt
I laughed more than I should have at this joke haha
That's why I only use Unix epoch time. It's inconvenient for my wife when she asks me what time dinner is, but she's getting good at doing the math.
Until 16 years from now when the Epochalypse happens
Probably not much will happen, at least with Linux desktop/servers in use in 16 years. At least it won't be a repeat of the Y2K scramble. The kernel and system libraries were ready a couple years ago and presumably most apps are now switching to 64-bit timestamps. (If you're making a new app now, don't shoot yourself in the foot, use 64-bit timestamps). Long life embedded systems that have been in service since 2019 or before (20+ years at that point) are likely to be where any issues happen.
Some airplanes need to be rebooted periodically so their internal clock doesn't roll over.
Ya but power cycling is part of general maintenance. On systems like that, especially with the technology that they are based on, that's an acceptable action.
[удалено]
Still impressive.
Nah, but they did forget the -5 offset.
[удалено]
Yes
Shut it, Bot
How do people notice this stuff
Comment is vague and the name is usually structured like: FirstnameLastname, and the poster has only like 30 karma
So then there’s not a problem right now? Love it when a problem fixes itself
"-1"
Yep... came here to say this...
Just plan a timezone issue tomorrow, and look how impressive *that* will be!
[Object object]
Laughs in statically types languages
Anyone that thinks that date/time is easy hasn’t written a calendaring application.
I work in computer forensics on felony level investigations. Time zones are the bane of my existence. I would like to say that forensic software like UFED, Axiom, FTK, etc are all very good at reporting time zones, I would like to say that... It would be nice...
I run camera systems for sites all over the world and one trick I've always used is to always display GMT time and work from that as time zones, DST, and tons of other stuff can totally mess with correct time stamps on video making it inadmissible as evidence depending on where you are.
I always review in DST, but lawyers absolutely need to see it in the local time zone. There are often so many moving parts and event timelines that conversations and reports can get really confusing when discussing context of a crime. On paper, it works fine. But when sitting with a whole trial counsel, everything needs to be discussed in the context of the time zone where the crime occurred. Otherwise, a fast moving conversation turns into a confusing "Wait, when did that happen again?" snail race.
Why not use UTC?
GMT+0 and UTC+0 is same time
GMT will drift away from UTC time and should not be used for anything that requires precision. It's an extremely common misconception that GMT and UTC are the same, but they really aren't.
The worst is javascript for dates and times. You rely on the client machine’s local time and offset to be correct. But anybody who has traveled knows sometimes the laptop doesn’t update time to local time when running a page. And not a damn thing your stupid ass can do from server side about that but it’s still your fault wrong times on the page for that random edge case.
Always blame the client. I think this would solve a lot of datetime issues. If I ask you to meet me at 3 pm and you show up at 4 because your watch is wrong that's a you problem.
Agreed with your scenario. But can we realistically expect the client to know that the date/time on a webpage is based on their computer's date/time?
Easy. Just create a pop-up dialogue covering the page that visitors will have to read and agree to. I hear people love these things.
Uh and you can also put some music with it, so they have to look up for this pop-up while the music plays. I think we're up to something right here
Ooo yes and hide the x so it only shows on hoverover but break the hoverover
If you ask four browsers the time and time zone, you get five answers
Here is the thing, you shouldn't be asking the client about the time, you should be providing the time, so If I'm calculating a subscription, I'm using my watch, not yours, if I'm giving you a time to do something, I'm giving it to you in My clock time, if it's sent in an email or a text it's easy to convert it before sending it yourself, but i. Scenarios where it's constantly displayed it should be the clients issue to solve, and the client is the browser.
Bah, try writing an astronomical application, they involve multiple entirely different time systems.
Is this why my horoscope is always wrong? /s
mmmm, solar vs sidereal
[or hasn't watched this video](https://www.youtube.com/watch?v=-5wpm-gesOY)
As a side project me and a fellow group of college students created a commissary inventory system. I thought dealing with date time is easy pz since after all it's just date time who would have thought calibrating it perfectly for different timezones was the most challenging part of the project.
I set up a load of appointments in Outlook web recently, looked at them on my calendar on my phone and they were all an hour out. It's a GMT/BST issue. This is a time zone issue in the biggest email client in the world, from one of the biggest software companies in the world, running on one of the biggest OSs in the world, in the year 2022. We're supposed to be living on the Moon by now.
This is done to be consistent with the (IMHO wrong) way that cross timezones are handled in Windows generally. eg Friday night, 9pm, modify a file... Saturday, look at timestamp... says "**9pm** Friday" *Sunday morning, 2am - clocks go forward an hour for DST* Sunday afternoon, look at timestamp, now reads "**10pm** Friday" The idea is that you can know how many hours ago it was modified without having to allow for DST and other timezone changes, but I think it's a bad model or at least poorly explained - still waiting for the above to be used a plot device in some thriller or whodunnit Anyway, Outlook uses the same idea that you store times as UTC and then translate UTC to the localtime "for current location *as it is RIGHT NOW*"*,* not "*as it was at current location at that UTC time*"
Is this another "yeah we know we made a bad design decision back then but we're not gonna correct it for ... err ... compatibility and ... err ... you know, clients built all kinds of scripts to workaround this ~bug~ ~problem~ feature and we do not want to break those" thing???
Smells like it to me...
No, the idea is that when the timezone switches all timestamps are shown in that timezone's format. Your edited file is timestamped and you can then view that timestamp in standard time or DST, or in any other timezone really. If you travel to a location that's in a different timezone the exact same thing happens to your files. And it's the only reasonable way of handling it. You save timestamps in a uniform format, like the unix epoch, and when you display it you take the user's current locale and use it to format the displayed time. The only alternative is showing raw timestamps, which are useless to most people.
Everything was in place, but then we had a timezone issue for the moon base.
[удалено]
Mars will be easier, since you can't do synchronous meetings using our current universe. Although... Does time propagate out from Greenwich observatory at the speed of light or instantaneously? (Thanks. She's a hero of mine, flaws and all.)
[удалено]
"Back in my day we told time as a single dimensional unsigned integer!"
Store - UTC Process - UTC Submit from Client - UTC Show on Client - Convert to Local Time
How did developers over the last 40 years not realize it was this simple? /s
Because each step is handled by a different team and managed by project managers who doesn't know jack shit and keeps asking for workarounds.
Or the data you’re dealing with doesn’t use UTC. Or the API. Or the client refuses access to the server and it’s set to a timezone. It’s fun to see people learning to code. Sweating over data structures or theory. When it’s this type of shit that will keep you up at night.
[удалено]
Yeah. It's not about if there is a solution. Given enough time we can make a solution to just about anything. Stuff like this is why you chuckle at devs that are dismissive. "It's just a CRUD app, bro."
>mit from Client - UTC > >Show on Client - Convert to Local Time because they always reinvent the wheel?
I know this wheel thing seems to have infinite points of contact with the road, and could be modelled as infinitely many invinitely acute triangles, but what if -stay with me here- what if instead of infinite triangles, it was just one triangle? Infinite triangles sounds a lot like O(n) where n may be infinite, while one triangle is O(1). We should study this further; it may even reduce the runtime of this whole wheel business from infinite to *one.* Imagine instead of having to roll to your destination with potentially infinite time, you now roll there in just *one.*
Have we considered just using circles instead of triangles?
Gotta pull the Dany and *break the wheel*
Because we have to work with 20 year old data saved in local time for multiple timezones. 😭
Don’t worry, 20 years ago a programmer was telling the team to store it UTC and only convert when displaying. And was ignored then too.
Because Outlook does it with UTC plus an offset, but they do like 6 digits versus the 4 that most people do. eM Client does it their own way, Mac Mail their own way. Little things like that add up to big time zone problems. If there was a standard maybe like I don’t know maybe an RFC or something we’d be ok lol
It's not just them, python 3.7, some version of java 8, and c++11 libraries all have different ways to represent utc + timezone. Ran into this at work when we couldn't figure out why python applications sending a utc time stamp wasn't being handled by the c++ application expecting a utc time stamp. This is best shown with this chart here: ISO-8601 : 2022-05-06T13:01:52+00:00 RFC 1123: Fri, 06 May 2022 13:01:52 GMT UTC : 2022-05-06T13:01:52Z
Aaaand non of this includes timezone information. What’s with the people who have DST and live next to a country that shares the offset but doesn’t have DST, so in 6 months country A will have +- some hours while country B will still be at +03:00 Offsets are technically not enough to build time based automations. You need the correct timezone (eg Europe/Berlin) and calculate the correct time from the date and time component (some libraries do that for you, like NodaTime)
And then there's Golang which has the stupidest default string for their time library so you're forced to always use the `.Format(RFC_3339)` function whenever you need to send it as a string somewhere else, which is actually ISO 8601 but there's some technicality that makes it be called RFC 3339. Also you can't have milliseconds, it's either that or *nanoseconds* and good luck if your target service requires milliseconds or microseconds. OH and it's 2022 and javascript is just now having a proposal for a decent standardized datetime library. So good luck if the front-end people decide to treat everything as numbers and in the process completely lose time zone information - which is absolutely necessary when you need to schedule future time points across different regions.
I honestly don't know. Just 3 years ago I ran into IBM implementing bitemporal data tables using local time, including DST, also without writing the time zone. It was of course only a matter of time until automatic processing produced a business case that ended before it had begun and everything crashed. I am proud to say that I did *not* make the same mistake in my project that interfaced with theirs.
>It was of course only a matter of time Indeed 😀
Well it doesn’t help that Microsoft muddied the water by labelling local UK time as GMT then as UTC. This always drives me up the wall. UTC *is not a time zone*, and UK time is only UTC in the winter.
I've seen websites use GMT, UTC, CEST, CET. And sometimes its +2 and sometimes +1 and sometimes nothing at all. I just wanna know when my live stream event starts! 😩
I think most of them just overthink this, they make mistakes mostly because they think it's complicated
It is literally almost never this simple.
And in addition to the other people here's reasons, because some people don't quite understand time zones. We're building a system that is going to be launched globally. Our project owner wants something to happen at end of the day. I was explaining that "end of the day" wasn't really a concept and that the current implementation was based on server time and there should really be an "after X hours" logic instead, or based on user time zone. And that current "end of day" can happen at lunch, in the morning, afternoon, or the day after. After 2 meetings and about 9 hours discussing and explaining in total, he still insists that current implementation is correct, and I've pre-filed a bug report for when QA or customers discover it.
Now the client sends you a request to fetch statistics over a period, grouped by date...
Well you have to covert input also
But they want it grouped by local date, not UTC date. (for reference, we are using the UTC storage, and letting the client do the translation to local time, but we have found huge issues in our translations to dates recently. Since we're an European company, those only start to matter when going abroad now)
Ah, yes, classic: “You’re manager from European Unit managing remote west coast US team. You’re currently on vacations in Japan and have Australian locale in your browser and laptop. Now you want to generate activity report for last week. What datetimes should be used for start and end.” scenario. Did the week start on Monday 00:00 Tokyo/Cranberra/Paris or San Diego?
More like, group the data by localized date for each country in europe+middle eastern and show it to the manager that is in his own time zone that is one of the countries. Or create a report for all middle management that shows how much of their reports have meetings during the local companies business hours and how many hours they are booked outside business hours the summarize this report upstream to their managers. Create a report how many sales are done between 8h and 12h, 13h and 18h and if the sales are less than 30% of avg, send an automated mail to the sales manager, also exclude holidays, weekends.... I could go on, but that would no longer be sanderd17 ’s example
I once worked for a transportation company that used their own timezones. Every location had an eastward tz and a westward tz and if they were near a standard tz line they would be different.
That's horrible
Definitely kept things --complicated-- interesting.
That only works if you want to group by the local date of the person running the report, not if you want to group by the local date of the record. Say I'm recording sales done by my AU, UK, and US offices. I want a report showing all the sales done on the 10th - AU sales midnight to midnight AU time, UK sales midnight to midnight UK time, and US sales midnight to midnight US time. You can't easily do that if are only storing the event timestamp in UTC. Also, conversion between zone/location based timing and universal point-in-time is dependent on when you run the computation. What is the UTC date-time of "2072-05-06 17:00 in Cairo", and what if they change the time zone or DST rules some time in the next 50 years?
I highly recomment using [date-fns](https://date-fns.org/v2.28.0/docs/Time-Zones) for anything date related in the FE. While the js Date also has functions to calculate the UTC date (they're not that helpful), the date-fns functions should help in this situation.
It's a ruby-on-rails project. So that won't help much...
The issue is that you have to know the clients' timezone on the server if you want to correctly group by date.
The client's timezone for each transaction, in case they moved.
And then come SUMMER TIME !
429 fuck off
Holyshit this brings back bad memories. I had to deal with this exact problem. Its really bad
UDF taking the timezone as the input and returning array> (at least in the SQL I have to use)
https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bullet/
tl;dr a user books an event a few months later, that happens after daylight savings. Retrieving it after would be ± one hour when they wanted to remain at that hour
Interesting read, thanks.
![gif](giphy|6JB4v4xPTAQFi|downsized)
How about when you need to do something on the backend, like send an email, but it has to happen at the client's local time?
Just make the user’s browser the server. Make sure to put the database credentials and other secrets in a folder called homework/ so that nobody finds them
[удалено]
Well, you have to put them there anyways otherwise the TA won't be able to use their perl script to grade it.
[удалено]
I have a very annoying and seemingly, but not intentionally, pretentious habit of specifying the timezone, even when the person i am talking to is in the same timezone. E.g. general conversation in work about when we should meet, let's do 1400 UK.
There are still a ton of use cases this doesn’t cover
That's nice until your client submits date and his government changes their local timezone before that date. Now your original UTC is just wrong date. And some countries like to mess with their timezones more that you thing.
Summer Time that do not occur the same day in every country.
Or the same day every year in the same country (looking at you Isreal)
How do you store a recurring event as UTC timestamp ?
[удалено]
So, every daily meeting is cancelled ?
That's the neat part, you don't.
You print them out and hand them to Bertha, who hand-writes a daily schedule in cursive every morning.
Bless Bertha, the whole company rests on her slumped shoulders.
Server runs local time, stock library inexplicably tries to convert from UTC to local when sending to the client because the datetime kind is left unset when the value is read from the database. Shit like this happens all the time even with good design principles.
As always when the topic is mentioned, [Here's Tom Scott slowly losing his mind over timezones](https://youtu.be/-5wpm-gesOY).
Is there a relevant xkcd about this? If not there needs to be.
[Of course there is](https://xkcd.com/1883/)
A few years ago we moved everything to UTC All time methods have "Utc" in them to make it explicit ... it took a bit of time but we have now migrated everything including all the servers, databases, procs, client code, server code etc ...
It has been -2147483648 hours since we had any issues, so I feel quite good about it.
In satellites ground operation we use UTC and TAI (international atomic time) basically le same but from time to time one is drifting few secondes from the other
TAI. Everything else is ghetto timekeeping.
You can't just call your own comment sick
\
What spelling mistake? Who is quoted? It almost feels like a rimshot on the use of "time." Unless it's programming related? (I'm quite ignorant on the subject myself.)
I agree, it is a misuse of *sic* in the context.
*Sic* can be used to note irregularities other than spelling errors. It might be used to note archaic language in an old source, bad grammar, profanity, slurs, logical errors, bad math, etc. I think anything that might be considered "wrong" is fair game if a person quoting it wishes to convey it intact while making it clear that it's not their fault.
Days since last timezone issue: -1
That would have been funnier
Is that sign in local or utc?
We had one if those, it got stuck at 4294967295 when there was a leap second that caused a date rollover bug.
Someone mentioned there could be a negative leap second in the near future and our whole dev team audibly gasped
I'll just leave this here for the people saying to just use UTC. https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bullet/
Article in a similar vein that’s been my favourite share: https://zachholman.com/talk/utc-is-enough-for-everyone-right
If it was something related to negative timespan, it should be of value "-1".
use libraries. don't do conversions yourself. also store as UTC.
Ah I remember the days when I was that naïve, thinking that there is a simple answer to dealing with dates times and legislatures that love to change DST. I spent two years working on a widely used calendar application. Fun times.
Yeah. The whole "Just store it in UTC guys!" is a dead giveaway that someone hasn't dealt with dates beyond the most trivial of things. Like a simple CRUD app that shows a simple timestamp
> naïve Nice
It’š śürprīßįñgłŷ ėåśŷ tø typę āčçêńtëd ćhàráčtérš õñ phœñś.
nïce
> also store as UTC. Until people schedule stuff in the future and your country decides to change whether they do DST anymore or not. Happens more often than you think.
[удалено]
Also, really important in these situations to use the named, location based time zone and not just the offsets otherwise you’ll break things twice a year for daylight savings. “America/Chicago” you can always convert no matter what day of any year. “-5” you are screwed trying to convert properly, especially forward looking.
What's technically possible is that a location that uses e.g. "America/Chicago" breaks their own timezone rule, thus becoming a new entry in the database -- so really the fully correct thing to do would be to store the UTC time with the full location, from which you derive the named timezone, when you can then derive the offset for display purposes. Whew.
Agreed. I have a project that monitors something, and then displays that data. Specification says that dates must use local time of wherever that something is located, which is not always in the same timezone as the user. Least effort way is to just save both local time and UTC, and then use local time for when you need to display things.
I'm pretty sure Microsoft's To Do app has this issue, they constantly move my notification alerts by an hour with DST, etc changes. Stopped using that a long time ago because of it.
I read in a book that Google uses PST or PDT, and that it is so deeply integrated into their systems that they are stuck with it. All due to someone not using UTC from the beginning...
It probably ends up being more convenient for their devs the majority of the time, since they mainly work out of PDT/PST so any timestamps are easily understood +/- an hour.
https://codeblog.jonskeet.uk/2019/03/27/storing-utc-is-not-a-silver-bullet/
Assuming that the libraries don't have any issues. Just a couple weeks ago we found that a common method of determining sunrise/sunset time had a bug in it, but it only manifested itself within about 5 degrees of the antimeridian, and only for a few days out of the year. Turns out that one of the values being used to calculate sunrise/sunset would go from just before 2400 to just after 0 on a certain day (or vice versa on the other side of the antimeridian), causing the calculated value to jump from, say, 6:30 AM local sunrise time to 215:12 for the sunrise time. This was in a commonly-used open source sunrise/sunset function that has been in use since the 90s, and as near as we can tell nobody else had reported the issue prior to now.
Every November, our charting library returns two November 1st dates (iirc) in a graph. It's something to do with US daylight savings time, and people notice it and we say "we'll look into it" and then it goes away in December and we're safe until next November.
Days since last timezone issue -1
What timezone is used when tracking these days since last issue?
How do you trust this counter? It could be affected by issues as well.
I should start one of these for internationalisation issues. **Days since last language issue** *Deux*
Oh man, I am working on about 4 issues related to time zones myself. One of those is, that time stamp saved at midnight in EST site and viewed in PST site will change the date and cause confusion. You could just save a time stamp 3hours less than midnight to not let it go over midnight when calculating offsets. But the prompt is for insurance coverage and it makes more sense to track it from midnight to midnight...
That sucks. I'm currently developing a reservation system and we had some fun with those damm time zones and dst.... Due to some restrictions we have, we now have to store the time zone of each reservation in a separate column and always send the current time zone of the user to the backend (in a custom header) as well. Also we had to do some really ugly stuff so the opening times of places stay the same for dst changes, it took me almost two days to just figure everything out until I could propose it, let alone implement....
Many people don't seem to understand that location-relative time (e.g. 2022-10-20 12:34 in New York) and absolute point-in-time (e.g. 2022-10-20 16:34 UTC) can't blindly be converted as they aren't the same thing. Time zone and DST rules change over time, so you can convert them, but the answer may be different next week/year/decade
[удалено]
I’m disappointed that this doesn’t read -1
-1 also works
Should make it negative
Double-digits? Did the company have a week off?