tessel / t1-runtime

[UNMAINTAINED] Tessel 1 JavaScript runtime.
Other
117 stars 33 forks source link

DST-related test failure. #726

Open kevinmehall opened 9 years ago

kevinmehall commented 9 years ago

The following tests pass in Node. They pass in colony when the host time zone is PST, but not when it is PDT. The tests have been disabled in #725, and are preserved here for later analysis.

var d = new Date();
var offset = d.getTimezoneOffset() * 60000;
var offsetMinutes = (offset / 60000 % 60);
var offsetHours = (offset / 3600000 % 24);

d = new Date();
d.setHours(16);
d.setMinutes(0);
tap.eq(d.getUTCHours(), Math.floor(16 + offsetHours) % 24);

d = new Date();
d.setUTCHours(16);
d.setUTCMinutes(0);
tap.eq(d.getHours(), Math.floor(16 - offsetHours) % 24);