1053Creating & Displaying a Local Javacript-based Clock


Organizing meeting across time-zones can lead to mis-communication of the meeting start-times, especially when daylight-saving-time changes are involed.


Show the Meeting Start Time AND the current Local Time at the Meeting Website.

var f = new Intl.DateTimeFormat([], {
  timeZone: 'Asia/Tokyo',
  hour: 'numeric',
  minute: 'numeric',
  second: 'numeric',
  hourCycle: 'h23'
var setTime = () => document.getElementById('time').innerHTML = f.format(new Date())
setInterval(() => setTime(), 1000)

Intl.DateTimeFormat creates a new Intl formatter. Time to be displayed: Asia/Tokyo. Displayed are only: hour, minute and second. The hourCycle' optionh23` sets the display to a 24h clock.

setTime is a function that sets the innerHTML of id element time to the current Date, formatted with the Intl date.

setTime() call the function once on load.

setInterval() repeatetly calls the setTime() function to update the clock.

915SSH form OSX to Ubuntu – Locale Error

Problem: ‘std::runtime_error’ what(): locale::facet::_S_create_c_locale name not valid Aborted Solution: export LC_ALL="en_US.UTF-8" via http://martinhjelm.github.io/2015/06/14/Runtime-error-when-sshing-from-OSX-to-Ubuntu/