Complete
over 5 years ago

By Design.

Corrupt time_offset in a watch app FIT file when time zone is negative.

The problem is in the "time_offset" field in the "device_settings" message in the FIT file generated from a watch app.

The time_offset value is correct with a positive time zone but it is corrupt when the time zone is negative.

To replicate

A. to show it works with a positive time zone:

Create an Activity file from a watch app in a time zone east of the Prime Meridian, i.e. with a positive time zone.

I tested in Sydney (UTC+11).

Decode the FIT file with FitCSVTool.jar

Observe the device_settings time_offset field is correct.

I received the correct value of 36900 (11x60x60)

B. to see the error:

Re run in a time zone west of the prime meridian, i.e. a negative time zone, like USA CA (UTC + 8)

Decode the FIT file with FitCSVTool.jar

Observe the device_settings time_offset field is incorrect.

I expect time_offset,"-28800" (-8x60x60), I receive, time_offset,"4294938496",

It's not a problem with FitCSVTool:

I receive the same incorrect value with my FIT file decoder, so the problem is not within FitCSVTool.

The problem appears to be the way the negative time_offset is being generated.

Work-around:

The work around is to subtract 0x1000000 from the incorrect value.



  • You're viewing this as an unsigned value and not a signed one.

    4294938496= 0xFFFF8F80, and the high order bit is set, indicating a negative number.  You're seeing something like -36736 

    I live at utc-7 and have never has a problem with the times in a .fit