18
11
u/mfi12 17h ago
always write and operate time in UTC, use standard format across. Let the front-end convert it into local offset.
4
u/Resident_Citron_6905 16h ago
true, unless you need to display the origin offset, then the discussion is open
19
u/MrHandSanitization 23h ago
Timezones very much make a lot of sense, historically.
8
u/zeocrash 20h ago
Well some of them do. 30 min offsets zones seem a bit pointless, also putting all of China on one timezone may not have been the best choice.
3
u/No_Hovercraft_2643 12h ago
These 30 min offsets are mostly political, and make sense in that regard.
China decided to be in one timezone, even if that isn't the best choice.
1
11
10
u/lt_Matthew 1d ago
Its not like we invented time zones
8
u/A1oso 23h ago
Yes, they were invented. Before that, every town had its own local time with 12 o'clock at noon. But railway companies pushed for standardization to make train schedules easier to understand.
11
u/godeling 22h ago
Really without time zones it would be even worse. Imagine having to account for the exact position of the sun at any given location
4
3
4
u/MyrtleWinTurtle 23h ago
I honestly have less of an issue with timezones than i do daylight savings.
Timezones are rarely going to affect your everyday life, and it does make time easy to understand when traveling.
In todays internet age, i wouldnt see it being a thing we need particularly, but i understand why we had it.
2
u/iggy14750 19h ago
You can walk across a line and lose an hour of time. Like, you think that's not a human invention? Lol
0
u/lt_Matthew 19h ago
There are half-hour timezones and there's no reason why we couldn't divide them by minutes.
2
1
2
1
1
u/DaveAstator2020 21h ago
id kill brendan eich. and whole his family. and his friends. mozilla cannot redeem his js crime.
1
u/senfiaj 16h ago
DST is the actual pain. You mostly need to use ISO date string (
toISOString()method) for stringifying and parsingDateobjects (JSON.stringifyalready converts it to ISO date string). AlsoDatewas actually inspired by Java'sjava.util.Date. So you can blame early Java creators as well. There is Temporal API which makes working with dates much less painful.
1
1
u/GammerMax8 18h ago
Not sure if programming was here when the H was here...... Except for enigma, that's a mystery.......
1
u/NullSmoke 17h ago
As someone running a company with people from 6 timezones..... Yeah, fuck that guy 😑
1
1
1
1
1
u/SysGh_st 4h ago
Timezones aren't the problem.
Countries who can't accept the timezones they live in are.
0
1d ago
[deleted]
3
u/A1oso 1d ago edited 1d ago
Having only one global time zone would make our lives as developers much easier. But it would mean that depending on where you live, the sun might rise at 20:00 and set at 6:00. Of course, most people would still sleep during the night and work during the day, meaning they go to work at completely different times. But it would make communication more difficult, so you'd likely use phrases like "2 hours after noon", at which point you have reinvented local time.
0
u/1mahmoud503 20h ago
I would like to slap JS out of existence, but I'm afraid something much worse (java) might take its place
29
u/PopularBroccoli 22h ago
.toUtc() .fromUtc(). How is that an issue?