is StartODay still not corrected?

var hist = ActivityMonitor.getHistory();

for (var k = hist.size() - 2; k >= 0; k--) {
var S1 = Time.Gregorian.info(hist[k].startOfDay,Time.FORMAT_MEDIUM);
var mydateStr1 = Lang.format("$1$ $2$ $3$ $4$ $5$ $6$", [S1.day_of_week.substring(0,3), S1.month, S1.day, S1.hour, S1.min, S1.sec]);
Sys.print(k + "[" + hist.size() + "]" + ": " + hist[k].steps + " " + mydateStr1 + " |||" );

var delta2 = new Time.Duration(+Sys.getClockTime().timeZoneOffset);
var S2 = Time.Gregorian.info(hist[k].startOfDay.add(delta2),Time.FORMAT_MEDIUM);
var mydateStr2 = Lang.format("$1$ $2$ $3$ $4$ $5$ $6$", [S2.day_of_week.substring(0,3), S2.month, S2.day, S2.hour, S2.min, S2.sec]);
Sys.print(k + "[" + hist.size() + "]" + ": " + hist[k].steps + " " + mydateStr2 + " |||" );

var startOfDay1 = Time.today().add(new Time.Duration(-86400 * k));
var myinfo = Time.Gregorian.info(startOfDay1,Time.FORMAT_MEDIUM);
var mydateStr = Lang.format("$1$ $2$ $3$ $4$ $5$ $6$", [myinfo.day_of_week.substring(0,3), myinfo.month, myinfo.day, myinfo.hour, myinfo.min, myinfo.sec]);
Sys.println(k + "[" + hist.size() + "]" + ": " + hist[k].steps + " " + mydateStr);
dc.setColor(Graphics.COLOR_BLACK, Graphics.COLOR_TRANSPARENT);


}



Results in this. I'm at +8hr timezone.

5[7]: 666 Fri Jun 26 16 0 0 ||| 5[7]: 666 Sat Jun 27 0 0 0 |||5[7]: 666 Sat Jun 27 8 0 0
4[7]: 555 Sat Jun 27 16 0 0 ||| 4[7]: 555 Sun Jun 28 0 0 0 |||4[7]: 555 Sun Jun 28 8 0 0
3[7]: 444 Sun Jun 28 16 0 0 ||| 3[7]: 444 Mon Jun 29 0 0 0 |||3[7]: 444 Mon Jun 29 8 0 0
2[7]: 333 Mon Jun 29 16 0 0 ||| 2[7]: 333 Tue Jun 30 0 0 0 |||2[7]: 333 Tue Jun 30 8 0 0
1[7]: 222 Tue Jun 30 16 0 0 ||| 1[7]: 222 Wed Jul 1 0 0 0 |||1[7]: 222 Wed Jul 1 8 0 0
0[7]: 111 Wed Jul 1 16 0 0 ||| 0[7]: 111 Thu Jul 2 0 0 0 |||0[7]: 111 Thu Jul 2 8 0 0


some of the code from the above is not correct, I am unsure of which is supposed to be the correct one.
StartOfDay is supposed to be fixed in the latest SDK rev, but which is it normalised to? I tot it was supposed to be midnight?


http://developer.garmin.com/downloads/connect-iq/monkey-c/doc/Toybox/ActivityMonitor/History.html#startOfDay-instance_method
  • Put a pad of paper and a pencil next to your bed, and fall asleep NOT thinking about the problem,.. You may wake up in the middle of the night, scribble something, and the go back to sleep. When you wake up the next morning, you'll either have a fix for what you're doing, or a page filled with random scribbles! :)
  • Former Member
    Former Member over 10 years ago
    Just to confirm, You are seeing times from Activity Monitoring history at local Midnight without any manual adjustment on devices correct? That is what you should see.

    However, in the simulator, you are seeing values are off by the current timezone?

    We will look into the simulator issue. As Jim mentioned, we just added the simulator feature, so it is possible something was not converted correctly.
  • Just to confirm, You are seeing times from Activity Monitoring history at local Midnight without any manual adjustment on devices correct? That is what you should see.

    However, in the simulator, you are seeing values are off by the current timezone?

    We will look into the simulator issue. As Jim mentioned, we just added the simulator feature, so it is possible something was not converted correctly.


    correct. Sim is not working