get user timezone offset

PHOTO EMBED

Wed Aug 17 2022 21:27:03 GMT+0000 (Coordinated Universal Time)

Saved by @mmerkley #html

// get timezone offset
function get_time_zone_offset( ) {
  var current_date = new Date();
  return parseInt(-current_date.getTimezoneOffset() / 60);
}

// get timezone name example 'MDT'
var zone = new Date().toLocaleTimeString(undefined ,{timeZoneName:'short'}).split(' ')[2]
console.log(zone);

// Convert to ISO String
new Date('Date goes here with Time Zone on End like UTC or MDT').toISOString();

// Note that the datepicker UI has a field to select Timezone
content_copyCOPY