03-30-2019 05:01 - edited 03-30-2019 05:09
03-30-2019 05:01 - edited 03-30-2019 05:09
I cannot, for the life of me, figure out what has changed to cause this.
When I run a watchface I wrote on the simulator, the time it shows is 2hrs ahead of the PC's time.
The PC's time is correct for Melbourne, Australia.
This is what I use to get the hours. When I 'console' output 'hours', it shows the +2hrs time, so it is not a rendering problem. It really thinks it is 2 hrs ahead.
...
let now = new Date();
let hours = now.getHours();
...
When I send that watchface to the watch itself, it shows the correct time.
I am running Fitbit OS Simulator v0.70 on Win8.1upd2.
I use Chrome to run Fitbit Studio.
Any ideas?
Cheers,
Nick
Answered! Go to the Best Answer.
Best Answer04-03-2019 10:50
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
04-03-2019 10:50
We're aware of this issue and we have a fix coming in the next update. Sorry for the inconvenience.
03-30-2019 12:48
Gold Fitbit Product Experts share support knowledge on the forums and advocate for the betterment of Fitbit products and services. Learn more
03-30-2019 12:48
I think it's a bug in recent releases of the simulator. According to my digging, it's wrong by twice the time zone offset; I suspect someone plussed when they should have minussed, or vice versa.
It should be fine on a real watch.
I must admit that a watch that can't tell the time kinda tickles my funny-bone. I have a funny funny-bone.
04-03-2019 08:05
04-03-2019 08:05
It really looks like there is a bug in the new simulator version.
As long as I use the clock event, the time is correct:
clock.ontick = (evt) => {
console.log(evt.date.getHours()); // correct time, e.g. 11
}
But when I use the date object, for me the time is 4 hours behind
let date = new Date;
console.log(date.getHours()); // wrong time, e.g. 7
My timezone is GMT + 1, daylight saving time.
Uwe
Best Answer04-03-2019 10:50
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
04-03-2019 10:50
We're aware of this issue and we have a fix coming in the next update. Sorry for the inconvenience.
04-03-2019 12:45
Gold Fitbit Product Experts share support knowledge on the forums and advocate for the betterment of Fitbit products and services. Learn more
04-03-2019 12:45
const IS_SIMULATOR = goals.calories===360; // whatever the sim reports as your goals.calories
...
let date = new Date();
if (IS_SIMULATOR) date = new Date(date.getTime() + 22*3600000); // 22 is twice my time zone
Best Answer