Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Simulator time 2hrs ahead of computer time

ANSWERED

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

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

We're aware of this issue and we have a fix coming in the next update. Sorry for the inconvenience.

View best answer in original post

Best Answer
4 REPLIES 4

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.

Peter McLennan
Gondwana Software
Best Answer

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 Answer
0 Votes

We're aware of this issue and we have a fix coming in the next update. Sorry for the inconvenience.

Best Answer

 

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

 

Peter McLennan
Gondwana Software
Best Answer
0 Votes