Convert sensors timestamp in current date

Convert sensors timestamp in current date

BY 09 Oct 2019 Native Application Development

Hi everybody,
i’m trying to develop an app that collects milliseconds hear rate data and write them into a txt file. I need also to stamp on the txt the right time and date to know when the event has happened.
is there way convert the timestamp of the sensor into a format Hours:Minutes:seconds??



typedef struct
{
int accuracy; /**< Accuracy of sensor data */
unsigned long long timestamp; /**< Time when the sensor data was observed */
int value_count; /**< Number of sensor data values stored in #sensor_event_s::values */
float values[MAX_VALUE_SIZE]; /**< Sensor data values */
} sensor_event_s;

this is an example of how the .txt file comes up:

556 , 430919201689
556 , 430919254262
556 , 430919302796
556 , 430919356167
556 , 430919402654
556 , 430919454530
556 , 430919502442
556 , 430919554832
556 , 430919603255
907 , 430919655868
907 , 430919702992
907 , 430919754935
907 , 430919802831

The first column contains the milliseconds, while the second one contains the timestamp.
Thank you,

Written by