Skip to content

/etc/localtime symlink handling #26880

Open
@mat8913

Description

@mat8913
  • Version: v11.7.0
  • Platform: Linux gallium 4.19.25 1-NixOS SMP PREEMPT Sat Feb 23 08:07:27 UTC 2019 x86_64 GNU/Linux
  • Subsystem:

Node has trouble figuring out the timezone if /etc/localtime is an indirect symlink. Here's some examples in the REPL

> Date()
'Sun Mar 24 2019 01:42:40 GMT+1000 (GMT+10:00)'    # Wrong, it's GMT+11 in Sydney right now
> new Date().toLocaleString()
'3/24/2019, 1:42:55 AM'                            # Similarly to above
> Intl.DateTimeFormat().resolvedOptions().timeZone
undefined

Even worse, in electron:

> new Date().toLocaleString()
VM575:1 Uncaught RangeError: Unsupported time zone specified undefined
    at new DateTimeFormat (native)
    at Date.toLocaleString (native)
    at <anonymous>:1:12

This is the cause of FreeTubeApp/FreeTube#233. It might also be the cause of ValveSoftware/steam-for-linux#5609 and flathub/im.riot.Riot#32.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedIssues that need assistance from volunteers or PRs that need help to proceed.i18n-apiIssues and PRs related to the i18n implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions