NTP Date/Time from nrfConnect v1.2.1

For reasons beyond my control I need to do some changes to a nrf9160 project that was developed using nrfConnect v1.2.1.  I know the ideal situation is to upgrade it to the latest version, but it uses several deprecated config options that would require a lot of testing if I had to change.

I need to get the current time.. I thought I could easily do with the Date/Time module, but it looks like it isn't supported in v1.2.1.  Is there a way in that version to get the current time?  Or configure the modem to update the time as needed and then read the time from that?

Parents Reply
  • Thanks

    That makes a bit more sense on time format if the timezone is in quarter of an hour.

    But it looks like the date / time portion is UTC and doesn't have the timezone offset applied?

    For example, last night I received the following response

    24/04/23,01:48:50-20

    I am in US central DST, so the -20 offset makes sense.  But it shows 1:48 am on April 23 2024.  I read the time at 8:48 pm April 22 local time

    One additional question, for the function modem_info_string_get, it says a negative error code is returned if it isn't successful.  Where are the error codes documented?

    When does the modem time get updated?
    Can I programmatically tell it to update if the return value is negative?

Children
Related