Skip to content

Instantly share code, notes, and snippets.

@infertux
Last active December 30, 2015 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infertux/7887409 to your computer and use it in GitHub Desktop.
Save infertux/7887409 to your computer and use it in GitHub Desktop.
Gnome Shell: use a different time-zone for clock than the system time-zone
--- /usr/share/gnome-shell/js/ui/dateMenu.js.dist 2013-12-10 08:27:47.162670528 +0000
+++ /usr/share/gnome-shell/js/ui/dateMenu.js 2013-12-10 08:29:44.332848149 +0000
@@ -209,7 +209,11 @@
},
_updateClockAndDate: function() {
- this._clockDisplay.set_text(this._clock.clock);
+ let dateFormat = _("%a %d %l:%M:%S %p");
+ let date = new Date();
+ let offset = 3600*1000*N; // change N with the offset from UTC in hours
+ let clockDate = new Date(date.getTime() + offset);
+ this._clockDisplay.set_text(clockDate.toLocaleFormat(dateFormat));
/* Translators: This is the date format to use when the calendar popup is
* shown - it is shown just below the time in the shell (e.g. "Tue 9:29 AM").
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment