03-20-2019 03:55
03-20-2019 03:55
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
Answered! Go to the Best Answer.
Best Answer03-20-2019 03:58
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
03-20-2019 03:58
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
0time, ornullif no reading is available (when the sensor is not yet activated and there are no valid cached values that can be used).
Best Answer03-20-2019 03:58
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
03-20-2019 03:58
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
0time, ornullif no reading is available (when the sensor is not yet activated and there are no valid cached values that can be used).
Best Answer03-20-2019 04:00
03-20-2019 04:00
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 Answer10-04-2022 15:48
10-04-2022 15:48
What's the point of this timestamp then? If we cannot use it?
Best Answer