frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Fast

https://www.catherinejue.com/fast
330•gaplong•3h ago•94 comments

Optician Sans – A free font based on historical eye charts and optotypes

https://optician-sans.com/
120•exvi•4h ago•20 comments

Launch HN: Lucidic (YC W25) – Debug, test, and evaluate AI agents in production

74•AbhinavX•4h ago•18 comments

Emacs: The macOS Bug

https://xlii.space/eng/emacs-the-macos-bug/
49•xlii•2h ago•29 comments

Sleep all comes down to the mitochondria

https://www.science.org/content/blog-post/it-all-comes-down-mitochondria
477•A_D_E_P_T•12h ago•240 comments

Crush: Glamourous AI coding agent for your favourite terminal

https://github.com/charmbracelet/crush
260•nateb2022•4h ago•150 comments

Most Illinois farmland is not owned by farmers

https://www.chicagotribune.com/2025/06/01/illinois-farming-ownership-climate-change/
120•NaOH•2h ago•129 comments

The Preserving Machine by Philip K. Dick (1953)

https://archive.org/details/Fantasy_Science_Fiction_v004n06_1953-06
16•akkartik•1h ago•2 comments

Every champion needs a rival

https://tombrady.com/posts/every-champion-needs-a-rival
30•pbardea•2h ago•32 comments

Problem Solving Is Often a Matter of Cooking Up an Appropriate Markov Chain

https://www.jstor.org/stable/41548580
166•Alifatisk•8h ago•47 comments

Our $100M Series B

https://oxide.computer/blog/our-100m-series-b
549•spatulon•7h ago•365 comments

Critical Vulnerability in AI Vibe Coding platform Base44

https://www.wiz.io/blog/critical-vulnerability-base44
53•waldopat•4h ago•32 comments

Artie (YC S23) Is Hiring Founding AEs

https://www.ycombinator.com/companies/artie/jobs/CfSrcAH-founding-ae
1•j-cheong•3h ago

A short post on short trains

https://shakeddown.substack.com/p/a-short-post-on-short-trains
8•surprisetalk•6h ago•1 comments

The hype is the product

https://rys.io/en/180.html
83•lr0•2h ago•28 comments

Ultra-Rapid Vision in Birds

https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0151099
27•downboots•3d ago•2 comments

Polarizing Parsers

https://flak.tedunangst.com/post/polarizing-parsers
18•upofadown•2h ago•2 comments

Writing memory efficient C structs

https://tomscheers.github.io/2025/07/29/writing-memory-efficient-structs-post.html
90•aragonite•7h ago•39 comments

Scammers unleash flood of online gaming sites

https://krebsonsecurity.com/2025/07/scammers-unleash-flood-of-slick-online-gaming-sites/
39•todsacerdoti•1h ago•31 comments

Try the Mosquito Bucket of Death

https://www.energyvanguard.com/blog/try-the-mosquito-bucket-of-death/
282•almuhalil•7h ago•236 comments

I launched 17 side projects. Result? I'm rich in expired domains

108•cesargstn•7h ago•80 comments

.NET 10 Preview 6 brings JIT improvements, one-shot tool execution

https://www.infoworld.com/article/4023654/net-10-preview-6-brings-jit-improvements-one-shot-tool-execution.html
131•breve•3d ago•124 comments

Words about Arrays and Tables

https://buttondown.com/hillelwayne/archive/2000-words-about-arrays-and-tables/
48•todsacerdoti•5h ago•19 comments

Traccar: an open source GPS tracking system

https://github.com/traccar/traccar
9•saikatsg•3d ago•4 comments

From XML to JSON to CBOR

https://cborbook.com/introduction/from_xml_to_json_to_cbor.html
55•GarethX•10h ago•62 comments

Australia widens teen social media ban to YouTube, scraps exemption

https://www.reuters.com/legal/litigation/australia-widens-teen-social-media-ban-youtube-scraps-exemption-2025-07-29/
49•Brajeshwar•3h ago•79 comments

The HTML Hobbyist

https://www.htmlhobbyist.com/
186•janandonly•8h ago•100 comments

Maintaining weight loss

https://macrofactorapp.com/maintain-weight-loss/
58•MattSayar•2h ago•52 comments

Show HN: A high-altitude low-power flight computer for high-altitude balloons

https://github.com/New-England-Weather-Balloon-Society/Tiny4FSK
28•mpkendall•5h ago•14 comments

A Python dict that can report which keys you did not use

https://www.peterbe.com/plog/a-python-dict-that-can-report-which-keys-you-did-not-use
59•gilad•3d ago•34 comments
Open in hackernews

JavaScript decided my day starts at 9am

https://senhongo.com/blog/when-javaScript-decided-my-day-starts-at-9am
33•SenHeng•4d ago

Comments

kayodelycaon•20h ago
From MDN:

> When the time zone offset is absent, date-only forms are interpreted as a UTC time and date-time forms are interpreted as a local time

Fun!

Obligatory joke:

Brendan Eich created JavaScript in 10 days. And we’ve been fixing it ever since.

croemer•14h ago
Or 9 days, depending on the time zone you're in
svachalek•20h ago
Unless this is the absolute only place that's using dates/times it's worth bringing in a library for this. The built in Date class is miserable. Also see the new Temporal proposal https://github.com/tc39/proposal-temporal
hatthew•19h ago
My rule of thumb is: keep all business logic in UTC, and convert from/to local time as close to the UI as possible
yesco•19h ago
Adding to this, if you are dealing with dates in JavaScript specifically I recommend going further and doing all business logic with the UTC timestamp stored as a number / unix epoch, and only doing `new Date(timestamp)` when you need it in local time, like right before rendering on the page or something as you mentioned.

It obviously depends on your use case but I find most time operations are often easier to deal with as pure mathematical operations. I will reach for Date when I need to deal with weird stuff like the day of the week but having burned through so many footguns with what I consider the worst DateTime API I have ever dealt with in any language, I will do anything I can to avoid using it.

Some libraries like date-fns can help here, but can't always bring in new deps easily. I hope the new temporal API fixes things.

TheRoque•15h ago
I was thinking like that before, however now I think it's overkill. Millisecond timestamps are hard to read, they are stored as "bigint" in Postgres, which makes it sometimes annoying. What I prefer now is to use the date object, but remember that it's only UTC (and the machine where the code runs should be in UTC time too). It goes well with Postgres Timestamp+TZ field, and it's much more readable.
rrrhys•18h ago
I have always followed the same, but also found calendar events are a good carve out to this.

The user doesn't care about the timezone change yesterday (and shouldn't..), they just need to see their meeting at 10am.

deathanatos•17h ago
It is a good carve out, but it means you have to be careful.

For example, in my work, we handle appointment data, and we've gotten appointments sent to us from an upstream provider scheduled for non-existent local timestamps. (E.g., 2:30am in the middle of a spring-forward jump. That timestamp doesn't exist. Also in the fallback, where that timestamp is ambiguous.)

Even Google Calendar chokes on certain appointment times.

jahrichie•19h ago
utc is the way and never trusting client side time, granted this could be server side time i guess
xyzzy9563•19h ago
If you always store dates as unix seconds and display them as local time on the browser, you'll almost never go wrong. Most other strategies leave too much room for ambiguity.
jedimastert•19h ago
Ever-relevant Tom Scott descent into madness

https://youtu.be/-5wpm-gesOY?si=8HtG8fFeWbdeM4xh

sgentle•19h ago
There's a larger design issue here that becomes clearer if you think of timezones as something more like temporal reference frames. Every date and/or time is relative to something; it's just a question of whether that reference is explicit or implicit, and if it's implicit then how does it get resolved?

Your original code (inadvertently) used a UTC day: T00:00:00Z -> T24:00:00Z. Your new code uses a day in an implicit timezone, which gets resolved by the client (to its local time). So, if you send that dashboard to someone in Singapore or Australia, their day is going to be an hour off compared to what you see.

Ultimately, the design issue is: when someone says "Tuesday", do they mean Tuesday in their local time? Tuesday in Japan? Tuesday in the location of their company HQ? Tuesday in the timezone where they do the most business?

I think a lot of the reason people get mad about timezones is because they don't think clearly about their reference frames from the beginning, which leads to getting caught up in implicit time spaghetti later on.

blahedo•18h ago
It's worse than this: it's not just "what's my (app developer) reference frame for time in this app" but rather "what is the user's reference frame", and that is a thing that changes even for a single user.

I have been in a paper-notebook-calendar mode for a while now, but every time I've dealt with an electronic calendar app, it's been a struggle, because sometimes I write down a time relative to the time zone I'm in right now, and sometimes I write down a time relative to the TZ I'll be in when the thing happens (on vacation, at a conference, whatever). And for things in the latter category, I _want_ to visibly see the local-to-the-event time so that I can talk to other people about it, but I also want it to be in the correct time when I'm actually at the event so that I don't miss an appointment. This is trivially easy on a paper calendar I keep for myself and is Really Dang Tricky for electronic calendar apps.

esseph•18h ago
I use Google for some things.

One of the things you can do with Google calendar is have multiple timezones listed on your calendar. This way, it's easy to see when the even is regardless of what time zone is the source of reference. It's a lifesaver.

Note: This seems to work on Google Calendar web, but I can't find a way to do this with the mobile app (Android).

afiori•17h ago
The issue here is that timezone are often handled like an environment setting instead of as an element of the day-time-timezone tuple
SenHeng•14h ago
I've used the default Calendar app on my iDevices since forever and it has always done the timezone conversions auto-magically for me. The only extra bit of work I have to do is convert the date to my local time zone during input.
t0mas88•14h ago
I think developers need to clearly understand this and then make reasonable (ideally also visible) choices for the reference frame used in the frontend.

For example the last application I worked on used UTC everywhere in the backend, database, APIs etc and stored a timezone configuration per account. The frontend used that timezone when displaying any date/time and also for parsing user date inputs. With a few places having a timezone drop down next to an input in places where it made business sense for the user to mean an explicit timezone.

SenHeng•14h ago
Author here.

As mentioned elsewhere, Japanese SaaS rarely ever deal with timezones because there's only 1 timezone. And I think this was originally built this way (using YYYY-MM-DD for filtering) to avoid having to think about time zones, with the assumption that the YMD values were all that mattered.

In our instance, it doesn't matter where the dashboard is used. It's a service built in Japan for people living in Japan. The dates are stored in Japan Standard Time in the database, so even when the dashboard is accessed from outside Japan, the user is only interested in filtering the values based on Japanese dates.

Otherwise, I agree with you.

koito17•18h ago
Since Japan has exactly one timezone and most services are intended for use within Japan, many Japanese programmers are unaware of timezone-related logic. I've frequently encountered Japanese sites store dates as OffsetDateTime instances (rather than UTC Instants), and have frequently seen subtle bugs, like a web app's backend returning UTC+9 timestamps, and then subsets of the frontend format the date according to the user's local time. I witnessed this last week on a fairly big concert ticket website. The lottery application datetime was simply formatting the OffsetDateTime returned by backend. Then, for some reason, the lottery result announcement datetime was being passed through a different formatting function. Two adjacent timestamps were in different timezones and there were no visual indications of this. I learned a lot about the site's API when investigating. I later reported the bug and was told the service is not intended for use outside of Japan, so they won't fix.

I've also encountered games where device local time results in bugs when certain features are gated to durations within Japanese Standard Time. For one particular game, I contacted support and the response was similarly "this service is intended for use within Japan; please ensure your device time is set to Japanese Standard Time." The support representative actually went further and told me, "if you are using this service outside of Japan, then we cannot make any guarantees on [the app's] behavior or resolve issues."

To most programmers in the US or Europe, storing all dates as UTC and localizing datetimes in the frontend may seem like "common sense", but this is essentially 異文化 to many Japanese programmers, for lack of a better way to phrase it.

fushihara•18h ago
I just want to display the last updated time in the corner of a blog post. Overwriting local innerText with JavaScript for that is nonsense.

Displaying relative time like “1 day ago” is especially foolish. Does that mean between 0s–23:59:59? Or 24:00:00–47:59:59? Or perhaps 24:00:00–6d 23:59:59?

When you have multiple browser tabs open and switch between them, and you see “just now” — is it really just now? You last looked at that tab an hour ago. Maybe two hours? Maybe it’s been open since yesterday.

Sometimes I wonder why the Accept-Timezone header doesn’t exist in web browser requests. Using Accept-Language to switch webpage language based on the same URL is now commonplace.

There would likely be demand for a feature where the <html> contains a Unix timestamp, and the browser renders it using the client’s local time zone:

<time epochMs="1234567890123" format="YYYY/MM/DD HH:mm:ss" />

Just write it into static HTML and you’re done. No need for the server to compute relative times, and no need to rewrite it dynamically with JavaScript.

What happened to the movement to abolish daylight saving time? A few years ago, I kept hearing that the US and EU were moving toward ending it. Yet here we are, still observing DST this year.

Izkata•15h ago
> Displaying relative time like “1 day ago” is especially foolish. Does that mean between 0s–23:59:59? Or 24:00:00–47:59:59? Or perhaps 24:00:00–6d 23:59:59?

> When you have multiple browser tabs open and switch between them, and you see “just now” — is it really just now? You last looked at that tab an hour ago. Maybe two hours? Maybe it’s been open since yesterday.

I have a screenshot of two Jira comments that go from "one year ago" to "one hour ago" because the two comments happened to be something like Dec 31 and Jan 2.

johnisgood•13h ago
So it does not take the year into consideration? Well damn.
xorcist•12h ago
I am sure the "as a user, I should see relative timestamps" ticket was closed fast though! Another job well done!
whatevaa•17h ago
Nothing wrong with this. Operating in one timezone only simplifies things, no need to overcomplicate it.
dgfitz•16h ago
Following this logic, python 3 needn’t have been created.
bigDinosaur•16h ago
Obvious potential failure case: Japanese citizens who are travelling abroad.
koito17•16h ago
Many Japanese studying abroad use VPNs in order to circumvent services blocking overseas traffic.

Most businesses do not care, because it's harder to counter bots when allowing overseas traffic. Moreover, the number of Japanese who leave the country are a small fraction. For reference, the percentage of Japanese who hold a passport is 17%. A small fraction of the 17% represent students studying abroad (or other long-term stays).

There's enough internal demand that people travelling abroad (or studying abroad) are considered edge cases worth ignoring. As surreal as this sounds, this is the current situation.

ItsHarper•4h ago
Using a VPN doesn't change your time zone
phtrivier•13h ago
Thanks for the context, it felt really weird to see such a "rookie" bug on the front page of HN :)

(And I mean "rookie" in the "young an innocent sense" - I vividly remember the day I was asked to displayed timestamped data for IoT devices in both local times of the machine and the user. "Yeah, should take half the day" was my answer. Ooooh to be naive again...)

I suppose the sentiment must be the same as i18n for the USA ("what do you mean there are _other_ languages ? Oh, you mean Spanish ?"), unit systems for Continental Europeans ("what do you mean 'Imperial system' is still a thing ?), and currencies for everyone ("what do you mean 0.1 + 0.2 != 0.3 ?")

It comforts me (a bit) to think that our robot overlords will inherit all this complexity (by virtue of being created by us), and it might make their revolt slightly less effective.

sangeeth96•18h ago
Better way to set this from input type=“date”:

    const el = /* get handle to date element */
    const d = el.valueAsDate;
    d.setHours(0, 0, 0, 0);
I wonder why there’s no date-local like there’s datetime-local given this gotcha: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/...
cluckindan•12h ago
valueAsDate: ”The date returned should always be interpreted as a UTC time”

The setHours trick will probably not work as expected if the user is on a timezone with a positive UTC offset.

They select a date in their local time, but in UTC, the date is still the previous day’s date!

So when user selects 2025-07-30 in +09:00, the UTC datetime will be set to 2025-07-29T15:00:00Z. setHours will then make it 2025-07-29T00:00:00Z, the date part of which would be rendered in local time as 2025-07-29, a full day off from what the user intended.

sangeeth96•11h ago
Ah, dang it! Thanks! Now that I read it, even *-local ones won’t do what I thought they did? valueAsDate isn’t a thing there. Wish I could unvote myself or that comment. Note to self: never comment on HN when you’re groggy and on a phone and never trust Date APIs lol.

Can’t wait for Temporal to get here which hopefully irons these out better.

AdieuToLogic•18h ago
From the post:

  I knew that new Date('YYYY-MM-DD') sets the time to 
  midnight. What I didn’t know was that it sets it to 
  midnight in UTC.
This is all the Date constructor could do in this use-case. There is no timezone specified and assuming one other than UTC could easily result in undefined behavior.

I think a better "lesson learned" in this case is to remove all ambiguity from datetime types by internally using only UTC representations for calculations and reserve timezone usage for display purposes.

austin-cheney•17h ago
There is no ambiguity. The Date constructor provides a timezone offset:

    myDate.getTimezonOffset();
It outputs the number of minutes different from UTC time. I use this to display server time in both server local and zulu (UTC) via a WebSocket broadcast every 950ms.
AdieuToLogic•16h ago
>> I think a better "lesson learned" in this case is to remove all ambiguity from datetime types ...

> There is no ambiguity.

The ambiguity I referenced was regarding program logic, not how `Date` operates when given only the year/month/date part of an instant. Perhaps I should have said instead:

  I think a better "lesson learned" in this case is to
  remove all ambiguity when using datetime types
  by internally using only UTC representations for
  calculations ...
And, yes, I do see the irony in this. :-)
SenHeng•14h ago
I've only just realised people mean UTC0 when they say store/use dates in UTC. For some reason, I've always thought it meant storing it in the ISO format. YYYY-MM-DD HH:mm:ss.sssZ which I've always done.
gnabgib•18h ago
Related:

Why are 2025/05/28 and 2025-05-28 different days in JavaScript? (144 points, 2 months ago, 153 comments) https://news.ycombinator.com/item?id=44113397

New Date("wtf") – How well do you know JavaScript's Date class? (409 points, 18 days ago, 236 comments) https://news.ycombinator.com/item?id=44540241

CuriousRose•16h ago
I'm building a fairly large SaaS product that will have global users and show financial reporting across different regions. Nothing gives me more anxiety as a relatively new developer than storing and recalling date/time values from my Postgres database, being converted to/from/being displayed in my app.

I have all records stored in timestampz(3), but I have no idea if what I'm doing is best practice or how to audit said functions. Using luxon at the moment, but a guide or blog post for best practices would help put my mind at ease if anyone has one. I know dates as a library are complex, but the UX managing them isn't much better.

jpalawaga•16h ago
in general, backend life becomes way, way easier if you just store everything in zulu time, transmit in zulu, and localize it on the frontend (which is what javascript does by default anyhow, iirc).

maybe there are some cases where you want to store the timezone (e.g. you've displayed a datepicker and the user has expressly entered a timezone)--but normally you'll save headache by storing everything in zulu time.

if storing the timezone is important for those transactions, then I could potentially see that as warranting storage with a timezone as well.

basically, ask 'if the timezone matters' with respect to the information being encoded. if it's just for display purposes and can be ignored, then KISS.

petersellers•16h ago
When dealing with timestamps, it's easiest to store and process them in UTC for as much of your code as possible. This means pretty much all of your backend and database code. Only convert these values from UTC to other timezones when presenting this data to the user (at that point, you'd need to take the user's timezone(s) into account).
Traubenfuchs•15h ago
What are unit tests?
mediumsmart•14h ago
I remember using JavaScript when building websites.
tobyhinloopen•13h ago
Your first mistake is using Javascript's Date.

Js Joda is the only datetime library that doesn't make me wanna cry -> https://js-joda.github.io/js-joda/

It is kinda similar to the new Temporal api: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Or if you want to live on the edge: https://www.npmjs.com/package/temporal-polyfill

For experiments, I would strongly suggest to look into Temporal API.