As you can see, this preset required the calculation of the time based only on the offset and your current time… and required rotation based on those calculated times… below are the formula used…
//Part 1 - Time at Timezone Offset
var mtag=[m];
var htag=[h24];
var tzl=[t1_label];
var df = -(([gmt_offset])-[t1_gmt_offset]);
var mo = parseInt(df);
var so = df-mo;
if (so == 0) {
  var h = htag+df;
  var m = mtag;
} else {
  var h = htag+mo;
  var m = mtag+(so*60);
  if (m<0){
    m=m+60;
    h=h-1;
  }
}
h=h<0?(h+24)%24:h%24;
m=m%60;
var msg=tzl+" "+h+":"+('0'+m).slice(-2)

//Optional - Add Day-of-Week
var pre ="";
var suf="";
var dec_t=htag+(mtag/60);
var yest=-(dec_t);
var tom=24-dec_t;
var dec_to=h+(m/60);
var dy=[day_in_wk]-1;
dy=dftom?(dy+1)%7:dy%7;
dy=dy<0?dy+7:dy;
var dys=["Su","Mo","Tu","We","Th","Fr","Sa"][dy];
h>=12?suf=" "+dys:pre=dys+" ";

return pre+msg+suf

//Part 2 - Rotation for Timezone Text Direction
var mtag=[m];
var htag=[h24];
var df = -(([gmt_offset])-[t1_gmt_offset]);
var mo = parseInt(df);
var so = df-mo;
if (so == 0) {
var h = htag+df;
var m = mtag;
} else {
var h = htag+mo;
var m = mtag+(so*60);
h=m<0?h-1:h;
}
h=h<0?(h+24)%24:h%24;
return h>=12?180:0

//Part 3 - Rotation for Timezone Hand
var mtag=[m];
var htag=[h24];
var df = -(([gmt_offset])-[t1_gmt_offset]);
var mo = parseInt(df);
var so = df-mo;
if (so == 0) {
  var h = [h24]+df;
  var m = [m];
} else {
  var h = [h24]+mo;
  var m = [m]+(so*60);
  if (m<0) {
    m=m+60;
    h=h-1;
  }
}
h=h<0?(h+24)%24:h%24;
return 0.25*((60*Number(h))+Number(m))

//Part 4 - Current Time with Day
var dy = [day_a].slice(0,2);
var pre="";
var suf="";
[h24]>=12?suf=" "+dy:pre=dy+" ";
return pre+[h24]+":"+('0'+[m]).slice(-2)+suf

//Part 5 - Rotation for Current Text Direction
[h24]>=12?180:0

//Part 6 - Rotation for Current Hand
0.25*((60*Number([h24]))+Number([m]))

Leave a Reply

Your email address will not be published. Required fields are marked *