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
  • Hi,

    I changed my approach to get the time from the modem using modem_info_string_get with MODEM_INFO_DATE_TIME

    Here is the response I get

    24/04/19,18:50:33-20dy

    What is the '-20dy' portion represent?

    Is there way to retrieve the modem time in seconds since epoch?  Or do I need to parse the string to get the UTC date/time?

    Is the format and string length always the same regardless of the date / time?

    How / when does the modem time get updated?  Is there a way to know how recently updated it is?

Children
Related