question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider jsTimeZoneDetect

See original GitHub issue

The existing mechanism only bases its guess on the current offset (js: new Date().getTimezoneOffset()). You may want to consider using jsTimeZoneDetect instead.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
JorgenPhicommented, Apr 22, 2020

Why not Intl.DateTimeFormat().resolvedOptions().timeZone?

This is how moment-timezone “detects” a TZ. https://github.com/moment/moment-timezone/blob/d7f687ea598b205806decd83b78d3ea9ad11a569/moment-timezone.js#L356

If that fails, fall back to the current method for getting a TZ

0reactions
jurriancommented, Oct 25, 2022

@bashu @adamcharnock As requested I created a PR for this: #63 It will prefer the timezone and falls back to offset. Let me know if there are more improvements needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pellepim/jstimezonedetect - GitHub
This script gives you the zone info key representing your device's time zone setting. The return value is an IANA zone info key...
Read more >
Getting different timezone IE11 and Chrome browser for ...
From the jsTimeZoneDetect docs: Limitations This script does not do geo-location, nor does it care very much about historical time zones.
Read more >
Timezone Detect | Drupal.org
Timezone Detect is a lightweight module that leverages the jsTimezoneDetect library (included with the module) for automatic detection and ...
Read more >
jstimezonedetect - npm Package Health Analysis - Snyk
This script gives you the zone info key representing your device's time zone setting. The return value is an IANA zone info key...
Read more >
Auto-Detecting a User's Time Zone in Rails
We include the jsTimezoneDetect library via Rails Assets: ... I think that should be enough information to get you started.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found