My device creating data in Nano Sec how can we store in cumulocity

My device is creating data in nano second i.e.“time”:“2021-02-26T12:51:21.00051826Z” but cumlocity can take in micro secound i.e “time”:“2021-02-26T12:51:21.000Z” how should 1 store the data in Nano secound

The built in datetime parameters for cumulocity objects only support milliseconds. If you want to preserve this information you can always store it as additional string parameter within your data. Here is an example how it can be done for a measurement:

{
    "c8y_SpeedMeasurement": {
        "speed": {
            "value": 25,
            "unit": "km/h",
            "exactTime": "2021-02-26T12:51:21.00051826Z"
        }
    },
    "time": "2021-02-26T12:51:21.000Z",
    "source": {
        "id": "12345"
    },
    "type": "c8y_SpeedMeasurement"
}

Then you can evaluate the exact timestamp when processing the data later down the line.

This topic was automatically closed after 1083 days. New replies are no longer allowed.