johnny-co / MMM-OpenSprinkler

MIT License
0 stars 1 forks source link

OS EPOCH Date not set correct in OSi #2

Closed johnny-co closed 4 years ago

johnny-co commented 4 years ago

Had to code around OS epoch. They use local time but javascript epoch functions assume GMT-0.

const now = new Date();
var correctEpoch = Math.round(now.getTime() / 1000) + (epochTime - epochDevTime);
var myDate = new Date(correctEpoch * 1000);
return myDate;
johnny-co commented 4 years ago

Checking in code