Hacker News new | ask | show | jobs
by Folcon 1603 days ago
Why not offer the "dropdown" at a layer the browser manipulates?

IE, web component where you can set a format string and then the browser renders it substituting the info it has?

Then sites that need to know the date can ask for it.

There's a lot we could do by splitting stuff into permissions and some sort of standard templates.

2 comments

and then you can read it out to indirectly get the time zone anyway (albeit a less specific version of it, since you wouldn't have the DST info). also, sometimes you need to actually have the users time zone for things like e.g. scheduled blog posts, so that they will show up when the user expects them to, not their scheduled time in UTC or whatever.

I use a site that only does UTC, and time zone related complaints are the most common issue asked about on the forums

> IE, web component where you can set a format string and then the browser renders it substituting the info it has?

you can easily detect this

    - please display this localdatetime as a string
    - read it back and parse it
    - are they (almost) exactly multiples of 60 minutes apart?
    - if yes it's most probably your timezone
Do apps really need to read back strings they omitted?
they don't, but they can and by doing it they can check if the date has been changed by the browser because of time zone shift.