nodejs/node

/etc/localtime symlink handling

Open

#26 880 ouverte le 23 mars 2019

Voir sur GitHub
 (17 commentaires) (0 réactions) (0 assignés)JavaScript (35 535 forks)batch import
help wantedi18n-apistale

Métriques du dépôt

Stars
 (117 218 stars)
Métriques de merge PR
 (Merge moyen 18j 17h) (219 PRs mergées en 30 j)

Description

  • 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.

Guide contributeur