This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to get the timestamp to millisecond accuracy

Former Member
Former Member

When I export the data to .csv from the Garmin Connect Web app, I have the timestamp with an accuracy of 1sec. For some analysis, I need a better accuracy (for instance millisecond, but 0.1 second would already be enough). How can I get such a more accurate timestamp?

Thank you very much!

  • I have a distance sensor and I need to synchronize it with the powermeter.

    OK, I see. In the case that you are a coder or have one available for your project, then you have couple of other options available:

    1. If the watch supports the Connect IQ  technology, you may be able to read the time stamps with the help of a custom IQ app. Have a look at the Connect IQ API and SDK

    2. You can get a deeper and better access to the live data with the Garmin Health SDK, but unlike with the Connect IQ API, it would be more complicated to get access to it - basically it is reserved to enterprise partners and a subject of licence fees.

    3. You can alo use the LiveTrack streaming. It makes some of the activity data available live through HTTP requests. It contains timestamps including milliseconds. I wrote an Android application using the LiveTrack streaming, so I know it works.

    In the case of LiveTrack, let's assume the following address is the LiveTrack link of your activity (the SESSION_ID and TOKEN_ID will be two long strings)

    https://livetrack.garmin.com/session/SESSION_ID/token/TOKEN_ID 

    Then edit the link into the following form (just add the word /services/):

    https://livetrack.garmin.com/services/session/cSESSION_ID/token/TOKEN_ID

    It will return output in JSON form :

    {
      "sessionId": "1111111-11111-1111-1111-111111111",
      "token": "11111111111111111",
      "userName": "XXXXXXX XXXXXX",
      "sessionName": "Live Activity 11/30",
      "startTime": 1586287966273,
      "endTime": 1586374366273,
      "viewEndTime": null,
      "startLatitude": 0,
      "startLongitude": 0,
      "cancelled": false,
      "endsAtActivityEnd": true,
      "sessionType": "FITNESS_TRACKING",
      "activityIds": [],
      "sessionStatus": "InProgress"
    }

    As you can see, the timestamp is an unrounded unix epoch time in milliseconds

  • ... however, all inner values of the LiveTrack are again reported with timestamps containing milliseconds equal to 000. And the endtime millisieconds are equal to the starting ones, suggesting the watch increments internally the timer always by 1000 milliseconds anyway. If you need live data for inner points in milliseconds, then the LiveTrack will be of no help either. You'll need to try with the API's.

  • Former Member
    0 Former Member over 5 years ago in reply to trux

    Thanks again.

    With the LiveTrack streaming, times of the beginning of the tracking are given in milliseconds. Thank you ! But do you know if I can get also the time of the beginning of the measurement (for example, the power) in milliseconds ?

  • But do you know if I can get also the time of the beginning of the measurement (for example, the power) in milliseconds ?

    Not sure what you mean by "the beginning of the measurment", but I assume that all measurments start at the same point when you start the activity. However, I cannot exclude that there are some delays between individual sensors and the central unit, and especially at the external sensors like the power meter. I am afraid though, that even Garmin developers don't know what the delay of the signal transmission / recording at individual sensors is. 

  • Former Member
    0 Former Member over 5 years ago in reply to trux

    In fact, the start time I get in the return output in JSON form correponds to the time when I press "start LiveTrack" on my phone, that's it ? But then, I can start an activity and press another button on my watch, for example, to measure my speed. Do you know if there is a way to know exactly when I started to measure my speed ? 

    Thank you again!

  • I do not start LiveTrack on the phone. I've set it up so, that LiveTrack starts automatically when I start the activity on the watch. I have no idea whether the times match to milliseconds. Aside from the already mentioned times, and apart of the possbilities through the API's I do not know about any other way.

  • Former Member
    0 Former Member over 5 years ago in reply to trux

    Thank you very much ! I have activated the auto feature in LiveTrack, and now, it starts when I start the activity. I imagine that the measurement of the power begin at the same time.

    Thanks again for your help !