StackExchange sites - convert dates to local timezone

Converts dates to your local timezone

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Autor
darkred
Installationen heute
0
Installationen gesamt
91
Bewertungen
3 0 0
Version
2019.8.28
Erstellt am
15.12.2015
Letzte Aktualisierung
25.06.2020
Größe
4,24 KB
Lizenz
MIT
Wird angewandt auf

This script applies to StackExchange sites stackoverflow.com, stackexchange.com, superuser.com, etc.
The timezone that the StackExchange sites use is UTC i.e. +0000 (source)
So, this script converts the dates to your local timezone, in both:

  • tooltips 2015-12-14 14:11:13Z, and in
  • date text like Dec 14 at 14:11.

It also recalculates them whenever the page changes.


*It uses the jsTimezoneDetect JavaScript script (for getting the local timezone),
and the Moment.js and Moment-Timezone JavaScript libraries (for converting the dates).
Also note: jsTimezoneDetect does not do geo-location, nor does it care very much about historical time zones.
e.g. it may get "Europe/Berlin" when the user is in fact in "Europe/Stockholm" (they are both identical in modern time).

Known issues:

  1. While you are on the superuser.com homepage, every 1 minute the activity indicator which will show when new posts are asked or answered.
    Also, every relative timestamp, e.g. answered 1 min ago will become answered 2 min ago, and so on.
    Well, while using the script, the latter feature, i.e. "the relative timestamps being increased every 1 min" becomes broken, and they don't get updated anymore.
  2. if you reopen Firefox e.g. stackexchange.com, then session restore uses the timestamps for the tooltips from cache, so the script uses these cached values (refreshing the page (F5) fixes the issue).*

Related post I made in stackapps.com
Here's a script to convert dates to local timezone in Stack Exchange sites

Hosted at GitHub