98
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
this post was submitted on 30 Sep 2025
98 points (100.0% liked)
Slop.
794 readers
540 users here now
For posting all the anonymous reactionary bullshit that you can't post anywhere else.
Rule 1: All posts must include links to the subject matter, and no identifying information should be redacted.
Rule 2: If your source is a reactionary website, please use archive.is instead of linking directly.
Rule 3: No sectarianism.
Rule 4: TERF/SWERFs Not Welcome
Rule 5: No bigotry of any kind, including ironic bigotry.
Rule 6: Do not post fellow hexbears.
Rule 7: Do not individually target federated instances' admins or moderators.
founded 1 year ago
MODERATORS
Hardcoded EST time minus Localized current time. Works fine on EST devs machinr. CST user sees this.
Yup, this is it. Here's the data declared for the top bar:
The code that actually handles the timer is obfuscated, so I won't bother posting it, but you can see that it's correctly hardcoded to 4:00 AM UTC, which is equivalent to midnight EDT.
The seven-segment display uses entirely different unobfuscated code (at its own peril!):
expand to see code
The smoking gun is
const endDate = new Date('October 1, 2025 00:00:00').getTime();. The Date object methods work on local time so it shows a longer time if you're west of EDT, and (as of writing) if you're anywhere between Africa and New Zealand (UTC+00:00 or greater) the clock's already hit zero. Oopsy-daisy!Pretty sure you can fix this by just swapping out the argument to the constructor with the result of a call to Date.UTC, like so:
Good old JavaScript shitty date time handling. A classic.
Admittedly time is always hard, no matter the language.
But a language that doesn't yell at you when comparing different time stamps that may not semantically refer to times in different time zones is a bad language. Python's datetime might be a bit better if you have pylance enabled in your IDE to yell at you, I'm not sure if it would catch this error. Rust's
std::timehas the decency to not support hardcoding itsInstanttype, so you have to use external crates that probably force you to specify time zone.Python's datetime stuff is quite bad. They really fumbled it and I have to deal with naive vs timezone aware datetime objects. Very annoying. Django at least has warnings when you accidentally use naive objects.