Timestamps of companion app data
Data from the D4L Collect companion app on a watch (Samsung Galaxy Watch, Google Pixel Watch) has two timestamp columns:
| Column | Meaning |
|---|---|
timestamp | The corrected time of the value, in UTC (ISO 8601). Use this column. |
timestamp_ms | The time that the watch reported for the value, as Unix epoch milliseconds (UTC). |
The watch and the phone each have their own clock, and the two can differ by seconds or minutes. The watch also sends its data to the phone by Bluetooth, sometimes long after it recorded the values. To put all values on the same time scale, the companion app compares the clocks:
- The app reads the current time of the watch by Bluetooth and notes the time of the phone at the same moment. It does this when the watch connects, when the time on the watch changes, and before it fetches data.
- For every value, it takes the time that the watch reported and moves it by the difference between the two clocks. The result is the time on the phone's clock, which is the
timestampcolumn.
Because all devices that sync by Bluetooth are corrected to the clock of the participant's phone, you can use timestamp to compare data across them. The two columns usually differ by about a second. If the app can't read the time of the watch, it uses the time that the watch reported. The app also asks participants to correct the time when the clocks of the watch and the phone differ by more than 3 minutes.