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

Accelerometer Readout Timestamps (Fitbit Ionic)

ANSWERED

Hey everyone,

I am using the accelerometer API and I encountered a problem with the timestamps. I use this chunk

acc.addEventListener("reading", () => {
    for (let index = 0; index < acc.readings.timestamp.length; index++) {
      console.log(acc.readings.timestamp[index])})

to read the stamps. The resulting outputs in the console are 6 to 7 digit numbers. My experiments suggest that these numbers correspond to the milliseconds past since some event I don't know.

Do you know how to properly interpret these and how to convert them to a regular 12 digit (ms) UNIX timestamps?

 

Best

Simon

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

You'd need your own timestamp, the one in the sensor is:

Timestamp of the reading in milliseconds.

NOTE: this is relative to an unspecified arbitrary 0 time, or null if no reading is available (when the sensor is not yet activated and there are no valid cached values that can be used).

View best answer in original post

Best Answer
0 Votes
3 REPLIES 3

You'd need your own timestamp, the one in the sensor is:

Timestamp of the reading in milliseconds.

NOTE: this is relative to an unspecified arbitrary 0 time, or null if no reading is available (when the sensor is not yet activated and there are no valid cached values that can be used).

Best Answer
0 Votes

Hey Jon,

thanks so much for your fast reply. I think it would be incredibly useful to automatically have UNIX timestamps in the actual sensor readout.

 

Best

Simon

Best Answer
0 Votes

What's the point of this timestamp then? If we cannot use it? 

Best Answer
0 Votes