Time zone handling through nRFCloud

Hello everyone,

I've got a simple question here today. I'm making use of the nRFCloud on our nRF9160-based system.

When using the different APIs to nRFCloud, be it location history, messages, whatever, they may contain a "insertedAt" timestamp. I would like to use this timestamp as a "last seen" feature on my website. But these do not contain time zone info. I can get the time with time zone correction from the modem/LTE-network, and send this with some messages or put it in the meta. But this does not cover all data I request (like cell location data which is stored in the cloud after requesting). If I wanted to put the time from the modem in the meta, I would have to receive and resend every cell based position as well. With a low-power design, I would like to avoid this.

Today, I am sending GPS fix data as per the standard scheme (or cell location with no reply to device as fallback), and sending battery info and actual timestamp in a separate message. When I want to see just the location history, I would have to get the messages as well and match the times of the locations with the times of the battery-and-time-message. This seems like the long way around, and I'm hoping someone has a more elegant solution to this.

Does anyone have any tips as how to get time zone based on the data from the LocationHistory API? API response below as reference.

       {

            "deviceId""nrf-35151617000000",
            "type""fine",
            "serviceType""SCELL",
            "insertedAt""2022-10-27T04:52:29.459Z",
            "uncertainty""4542",
            "lat""00.49811435",
            "lon""00.52104759",
            "meta": {}
        },
Thank you all for all and any help!
Kind regards,
Torje
  • Hi Torje,

     

    When using the different APIs to nRFCloud, be it location history, messages, whatever, they may contain a "insertedAt" timestamp. I would like to use this timestamp as a "last seen" feature on my website. But these do not contain time zone info. I can get the time with time zone correction from the modem/LTE-network, and send this with some messages or put it in the meta. But this does not cover all data I request (like cell location data which is stored in the cloud after requesting). If I wanted to put the time from the modem in the meta, I would have to receive and resend every cell based position as well. With a low-power design, I would like to avoid this.

    Today, I am sending GPS fix data as per the standard scheme (or cell location with no reply to device as fallback), and sending battery info and actual timestamp in a separate message. When I want to see just the location history, I would have to get the messages as well and match the times of the locations with the times of the battery-and-time-message. This seems like the long way around, and I'm hoping someone has a more elegant solution to this.

    Does anyone have any tips as how to get time zone based on the data from the LocationHistory API?

    I am checking internally wrt. to this question. I will update you once I get feedback from our cloud team.

     

    I wish you a wonderful weekend!

     

    Kind regards,

    Håkon

  • Thank you, Håkon.

    After a brainstorming session we figured that we would always want to see times in the users local time, whether their in Norway or Nepal, regardless of where the actual device is. We just adjust the zulu time to the local users time zone. So it's really not an issue to us anymore. 

    Thanks, have a nice weekend!

    - Torje

Related