<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nRF9160 Date Time Desync Issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77385/nrf9160-date-time-desync-issue</link><description>Hello, 
 We&amp;#39;re currently using the nRF9160 module in an iOT device meant to run for a long time continuously. As part of this operation we&amp;#39;re tracking a date-time and using it to post to AWS. We&amp;#39;re taking advantage of the date time library code described</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Feb 2023 13:11:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77385/nrf9160-date-time-desync-issue" /><item><title>RE: nRF9160 Date Time Desync Issue</title><link>https://devzone.nordicsemi.com/thread/408560?ContentTypeID=1</link><pubDate>Tue, 07 Feb 2023 13:11:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bea9ff69-1527-4649-8330-70b2e045ac2f</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/jlciot"&gt;JLCIOT&lt;/a&gt;, and sorry for the late reply.&lt;/p&gt;
&lt;p&gt;Unfortunately, replies to very old cases have a tendency to be missed.&lt;/p&gt;
&lt;p&gt;The PR with the fix (which I linked to in my previous reply) was merged August 6th, 2021, and has been part of all NCS versions starting from v1.7.0.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Date Time Desync Issue</title><link>https://devzone.nordicsemi.com/thread/407871?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2023 02:08:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a727631-ba17-4515-9788-3105a1ad909f</guid><dc:creator>JLCIOT</dc:creator><description>&lt;p&gt;We are having this same issue on our boards.&amp;nbsp; Would someone provide an update on if the recommended fix solved this problem!!!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Date Time Desync Issue</title><link>https://devzone.nordicsemi.com/thread/323673?ContentTypeID=1</link><pubDate>Fri, 06 Aug 2021 09:02:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c622094-a86c-4449-a8cd-4007a3bc3747</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/ziirou"&gt;anicare-tero&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;No, I don&amp;#39;t think there should be any negative consequences of changing the type from int to tint64_t.&lt;/p&gt;
&lt;p&gt;We have opened a PR with this update: &lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/5245"&gt;https://github.com/nrfconnect/sdk-nrf/pull/5245&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As Simen explains in the commit, k_uptime_get() returns an int64_t, so storing the value in an int will cause an overflow after approximately 25 days, as you are seeing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Date Time Desync Issue</title><link>https://devzone.nordicsemi.com/thread/323662?ContentTypeID=1</link><pubDate>Fri, 06 Aug 2021 08:32:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8af0fbb0-6e68-4a92-8a83-16a207797b1c</guid><dc:creator>anicare-tero</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I just found out yesterday after reading this discussion that I have this same problem.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;nRF Connect SDK version: 1.6.0&lt;/li&gt;
&lt;li&gt;Modem firmware version: 1.2.3&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Our device search GPS once a week and after a GPS fix it sets the GPS datetime to Date-Time with date_time_set(). Then I&amp;#39;m calculating the delay for the next week&amp;#39;s target time and getting the current UTC time with date_time_now().&lt;/p&gt;
&lt;p&gt;I have also set&amp;nbsp;CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS=0 so the library won&amp;#39;t update the Date-Time without commanding it to do it.&lt;/p&gt;
&lt;p&gt;Here you can see from the logs that after 25 days it&amp;#39;s not responding correctly anymore:&lt;pre class="ui-code" data-mode="text"&gt;Jul 06 14:41:24 [00:02:06.592,620] &amp;lt;inf&amp;gt; application: Current UTC time from GPS has been set: 06.07.2021 11:41:24	// date_time_set()
Jul 06 14:41:24 [00:02:06.987,121] &amp;lt;inf&amp;gt; application: uptime_days: 0
Jul 06 14:41:27 [00:02:09.473,358] &amp;lt;inf&amp;gt; application: Current UTC time: 06.07.2021 11:41:26							// date_time_now()
Jul 06 14:41:27 [00:02:09.483,032] &amp;lt;inf&amp;gt; application: Calculated target UTC time: 11.07.2021 04:48:26

Jul 11 07:50:01 [03:57:16.162,139] &amp;lt;inf&amp;gt; application: Current UTC time from GPS has been set: 11.07.2021 04:50:00	// date_time_set()
Jul 11 07:50:01 [03:57:16.545,410] &amp;lt;inf&amp;gt; application: uptime_days: 4
Jul 11 07:50:03 [03:57:18.905,487] &amp;lt;inf&amp;gt; application: Current UTC time: 11.07.2021 04:50:02							// date_time_now()
Jul 11 07:50:03 [03:57:18.915,191] &amp;lt;inf&amp;gt; application: Calculated target UTC time: 18.07.2021 04:48:02

Jul 18 08:12:02 [26:41:23.327,484] &amp;lt;inf&amp;gt; application: Current UTC time from GPS has been set: 18.07.2021 05:12:02	// date_time_set()
Jul 18 08:12:03 [26:41:23.711,059] &amp;lt;inf&amp;gt; application: uptime_days: 11
Jul 18 08:12:05 [26:41:26.098,937] &amp;lt;inf&amp;gt; application: Current UTC time: 18.07.2021 05:12:04							// date_time_now()
Jul 18 08:12:05 [26:41:26.108,581] &amp;lt;inf&amp;gt; application: Calculated target UTC time: 25.07.2021 04:48:04

Jul 25 07:49:30 [12:16:26.470,001] &amp;lt;inf&amp;gt; application: Current UTC time from GPS has been set: 25.07.2021 04:49:30	// date_time_set()
Jul 25 07:49:31 [12:16:26.853,454] &amp;lt;inf&amp;gt; application: uptime_days: 18
Jul 25 07:49:33 [12:16:29.483,276] &amp;lt;inf&amp;gt; application: Current UTC time: 25.07.2021 04:49:33							// date_time_now()
Jul 25 07:49:33 [12:16:29.492,980] &amp;lt;inf&amp;gt; application: Calculated target UTC time: 01.08.2021 04:48:33

Aug 01 07:50:00 [34:39:01.667,724] &amp;lt;inf&amp;gt; application: Current UTC time from GPS has been set: 01.08.2021 04:50:00	// date_time_set()
Aug 01 07:50:01 [34:39:02.051,330] &amp;lt;inf&amp;gt; application: uptime_days: 25
######################################################################################################################################
Aug 01 07:50:03 [34:39:04.418,701] &amp;lt;inf&amp;gt; application: Current UTC time: 19.09.2021 21:52:50							// date_time_now()
Aug 01 07:50:03 [34:39:04.428,405] &amp;lt;inf&amp;gt; application: Calculated target UTC time: 26.09.2021 04:48:50
######################################################################################################################################&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s sad that testing this issue lasts for so long.&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/didrik-rokhaug"&gt;Didrik Rokhaug&lt;/a&gt;&amp;nbsp;do you think there could be any disadvantages or problems when changing that&amp;nbsp;&lt;span&gt;last_date_time_update&amp;nbsp;from int to int64_t? I think we have to do a next firmware release in this month so we have not enough time to test this fix completely before that.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Date Time Desync Issue</title><link>https://devzone.nordicsemi.com/thread/323587?ContentTypeID=1</link><pubDate>Thu, 05 Aug 2021 15:02:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9755abb-3cf6-4374-b448-22bce730f806</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve had a talk with the developer of the date_time library, and he suggested that it might be the last_date_time_update that overflows.&lt;/p&gt;
&lt;p&gt;Could you try to change the type from int to int64_t for the last_date_time_update field in the time_aux struct (line 70 in date_time.c)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Date Time Desync Issue</title><link>https://devzone.nordicsemi.com/thread/323043?ContentTypeID=1</link><pubDate>Tue, 03 Aug 2021 09:48:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7191169a-dc66-4b85-8c3a-601b2c26eb5f</guid><dc:creator>Sebastian Stein</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;sorry for jumping into the discussion. However, I am experiencing the same behavior with a nrf9160 DK, which I run in a continuous duty test.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Meta information:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;nrf9160 DK version: 0.9.0 | 2019.20&lt;/li&gt;
&lt;li&gt;nrf Connect SDK version: 1.5.1&lt;/li&gt;
&lt;li&gt;Modem firmware version: 1.2.3&lt;/li&gt;
&lt;li&gt;Date time library related prj.conf settings:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_DATE_TIME=y
CONFIG_DATE_TIME_MODEM=y
CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS=3600&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Issue description:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;At the month boundary between July and August, the date time jumped to late September and is not corrected despite of the update period of 3600 s. This issue occurred after 36 days&amp;nbsp;(5 hour precision) after the continuous duty test started. The time offset is around 4294959 s.&lt;/p&gt;
&lt;p&gt;Every 10 minutes, the DK acquires sensor data and sends them into a cloud service. The cloud service received the last valid data set at 2021-07-30 05:31:26 UTC. The date time has an offset since then. In the following you find two examples of raw data sets, which the cloud service has received since then.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="json"&gt;// Received at 2021-08-02 15:51:47 UTC
// The unix time stamps translate to 2021-09-21 08:54:26 UTC
{

   &amp;quot;ver&amp;quot;:&amp;quot;0.01&amp;quot;,

   &amp;quot;snd&amp;quot;:[

      &amp;quot;1632214466,LmLrs21,t0,19.100,0&amp;quot;,

      &amp;quot;1632214466,LmLrs21,t1,55.900,0&amp;quot;,

      &amp;quot;1632214466,LmLrs21,t2,993.600,0&amp;quot;

   ]

}

// Received at 2021-08-02 16:01:47 UTC
// The unix time stamps translate to 2021-09-21 09:04:26 UTC
{

   &amp;quot;ver&amp;quot;:&amp;quot;0.01&amp;quot;,

   &amp;quot;snd&amp;quot;:[

      &amp;quot;1632215066,LmLrs21,t0,19.300,0&amp;quot;,

      &amp;quot;1632215066,LmLrs21,t1,55.500,0&amp;quot;,

      &amp;quot;1632215066,LmLrs21,t2,993.600,0&amp;quot;

   ]

}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Furthermore, I gather logging information and send them to a server of mine. I&amp;nbsp; noticed two things in the log messages. Firstly, the time stamps of the log messages exhibit the same date time offset. Secondly, the modem seemed to had some issues with querying the time from a ntp server. However, this querying issue does not overlap with the first occurrence of the date time offset. Below you find a slightly censored log file. The time is given in UTC. Please note the jump in the time stamps between line 4 and 5 and please note the date time log messages beginning at line 12.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[2021-07-29 23:21:26] &amp;lt;dbg&amp;gt; lmSdi12.sdi12IssueCommandSequence: Sensor 4 - seq. retries: 1
[2021-07-30 02:01:26] &amp;lt;dbg&amp;gt; lmSdi12.sdi12IssueCommandSequence: Sensor 4 - seq. retries: 1
[2021-07-30 03:31:26] &amp;lt;dbg&amp;gt; lmSdi12.sdi12IssueCommandSequence: Sensor 4 - seq. retries: 1
[2021-07-30 04:01:26] &amp;lt;dbg&amp;gt; lmSdi12.sdi12IssueCommandSequence: Sensor 4 - seq. retries: 1
[2021-09-18 18:24:34] &amp;lt;wrn&amp;gt; cloudService: Could not send data, data buffered
[2021-09-18 18:24:34] &amp;lt;wrn&amp;gt; cloudUpdateTask: Sending failed
[2021-09-18 18:34:34] &amp;lt;inf&amp;gt; cloudService: Buffered data was send
[2021-09-19 13:04:26] &amp;lt;dbg&amp;gt; lmSdi12.sdi12IssueCommandSequence: Sensor 4 - seq. retries: 1
[2021-09-19 18:34:33] &amp;lt;wrn&amp;gt; cloudService: Could not send data, data buffered
[2021-09-19 18:34:33] &amp;lt;wrn&amp;gt; cloudUpdateTask: Sending failed
[2021-09-19 18:44:34] &amp;lt;inf&amp;gt; cloudService: Buffered data was send
[2021-09-20 00:43:30] &amp;lt;wrn&amp;gt; date_time: sntp_query, error: -116
[2021-09-20 00:44:00] &amp;lt;wrn&amp;gt; date_time: getaddrinfo, error: -11
[2021-09-20 00:44:30] &amp;lt;wrn&amp;gt; date_time: getaddrinfo, error: -11
[2021-09-20 00:44:30] &amp;lt;wrn&amp;gt; date_time: getaddrinfo, error: -11
[2021-09-20 00:44:30] &amp;lt;wrn&amp;gt; date_time: getaddrinfo, error: -11
[2021-09-20 00:44:30] &amp;lt;wrn&amp;gt; date_time: Not getting time from any NTP server
[2021-09-20 00:44:30] &amp;lt;err&amp;gt; at_cmd: Failed to send AT command (err:9)
[2021-09-20 00:44:33] &amp;lt;wrn&amp;gt; cloudService: Could not send data, data buffered
[2021-09-20 00:44:33] &amp;lt;wrn&amp;gt; cloudUpdateTask: Sending failed
[2021-09-20 00:54:34] &amp;lt;inf&amp;gt; cloudService: Buffered data was send
[2021-09-20 05:43:30] &amp;lt;wrn&amp;gt; date_time: sntp_query, error: -116
[2021-09-21 20:44:26] &amp;lt;dbg&amp;gt; lmSdi12.sdi12IssueCommandSequence: Sensor 4 - seq. retries: 1&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Date Time Desync Issue</title><link>https://devzone.nordicsemi.com/thread/321571?ContentTypeID=1</link><pubDate>Fri, 23 Jul 2021 12:31:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bc9ddd9-db0d-47d8-99b6-2edd57c84843</guid><dc:creator>Jstone40649</dc:creator><description>&lt;p&gt;Unfortunately no progress yet, since it takes so long to reproduce were finding it difficult to debug.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;1. It&amp;#39;s about 8 weeks, so for example on July 5th (7-5) the time reported as august 24th (8-24)&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;2. Yes, it appears to be consistent between devices.&lt;/p&gt;
&lt;p&gt;3. It&amp;#39;s my understand that the date_time library can pull from several sources, I think we have modem time and NTP enabled. We have not been tracking the source of each individual update, I&amp;#39;ll add that to our testing considerations going forward.&amp;nbsp;&lt;br /&gt;4. The error seems to appear 30 days after initial power-up, but there&amp;#39;s no other specific boundary.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;5. Before uploading we format the date-time to a JSON string, the cloud stores that string directly along side the date-time as the server sees it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;6. We&amp;#39;re working on something like this, but we don&amp;#39;t have long-term serial access generally so we&amp;#39;re working to get that info pushed up through the cloud.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;7. We don&amp;#39;t have a huge sample size for this, but it seems to trigger around 30 days after powerup.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your help looking into this, I&amp;#39;ll keep looking into it on our end and I&amp;#39;ll try to add in those extra considerations you mentioned.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Date Time Desync Issue</title><link>https://devzone.nordicsemi.com/thread/321513?ContentTypeID=1</link><pubDate>Fri, 23 Jul 2021 09:10:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e125003f-03d9-4a7b-b941-9c4f987cefef</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi, and sorry for the late reply.&lt;/p&gt;
&lt;p&gt;have you had any progress on this issue?&lt;/p&gt;
&lt;p&gt;I would like to have the developer behind the date_time library look at this ticket, but unfortunately, he is on vacation for another week.&lt;/p&gt;
&lt;p&gt;In the meantime, I have some more questions:&lt;/p&gt;
&lt;p&gt;1. How big is the time offset? What time values do you get?&lt;/p&gt;
&lt;p&gt;2. Is the time offset the same on all the failing devices?&lt;/p&gt;
&lt;p&gt;3. What source do you get the time from? Does the source change when the error appears?&lt;/p&gt;
&lt;p&gt;4. When did the error appear? E.g. was it at a month boundary?&lt;/p&gt;
&lt;p&gt;5. How are the timestamps handled on the cloud side?&lt;/p&gt;
&lt;p&gt;6. Could you add printks/log statements in the date_time library that prints the time received from the source?&lt;/p&gt;
&lt;p&gt;7. Does the error appear at the same time, or after the same runtime in different devices?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Date Time Desync Issue</title><link>https://devzone.nordicsemi.com/thread/320020?ContentTypeID=1</link><pubDate>Wed, 14 Jul 2021 12:33:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4472dfb5-748c-4634-96e1-448d068ec182</guid><dc:creator>Jstone40649</dc:creator><description>&lt;p&gt;Config wise we have: the date time interval at 3600, Date time modem and ntp are both set, the stack size for the date time thread is 1024, and the ntp query time is 5 seconds.&lt;/p&gt;
&lt;p&gt;The snippet covers most of the code related to getting date-times, and works as expected in testing.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void date_time_event_handler(const struct date_time_evt *evt)
{
	switch (evt-&amp;gt;type) {
	case DATE_TIME_OBTAINED_MODEM:
		printk(&amp;quot;DATE_TIME_OBTAINED_MODEM\n&amp;quot;);
		break;
	case DATE_TIME_OBTAINED_NTP:
		printk(&amp;quot;DATE_TIME_OBTAINED_NTP\n&amp;quot;);
		break;
	case DATE_TIME_OBTAINED_EXT:
		printk(&amp;quot;DATE_TIME_OBTAINED_EXT\n&amp;quot;);
		break;
	case DATE_TIME_NOT_OBTAINED:
		printk(&amp;quot;DATE_TIME_NOT_OBTAINED\n&amp;quot;);
		break;
	default:
		break;
	}

	/** Do not depend on obtained time, continue upon any event from the
	 *  date time library.
	 */
	k_sem_give(&amp;amp;date_time_obtained);
}

int dateTimeErrs = 0;

static void date_time_update(void)
{
    int err;

    // Start datetime update
    date_time_update_async(date_time_event_handler);

    // wait, DATE_TIME_TIMEOUT_S seconds for the datetime update to return
    err = k_sem_take(&amp;amp;date_time_obtained, K_SECONDS(DATE_TIME_TIMEOUT_S));
    if (err) {
            printk(&amp;quot;Date time, no callback event within %d seconds\n&amp;quot;,
                    DATE_TIME_TIMEOUT_S);
    }
    else
    {
        int64_t unixTime;   
        err = date_time_now(&amp;amp;unixTime);
        if (err)
        {
			dateTimeErrs++;
        }
        else
        {
			// We&amp;#39;re deviding by 1000 to get unix time in seconds instead of milliseconds.
			// TODO Consider finding an alternative method.
			ClockService_SetTimeUnix(unixTime/1000);
        }
		LOG_ERR(&amp;quot;DateTimeErrors: %d&amp;quot;, dateTimeErrs);
    }
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And then a little down the line we have this code, to convert from the unix timestamp to our structure&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;bool DateTime_FromUnix(DateTime* value, int64_t unixTime)
{
    time_t epoch = unixTime;
    struct tm timestamp = *localtime(&amp;amp;epoch);  
    return DateTime_Initialize(value, 1900 + timestamp.tm_year, 1 + timestamp.tm_mon, timestamp.tm_mday, timestamp.tm_hour, timestamp.tm_min, timestamp.tm_sec, 0);
}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I don&amp;#39;t think we have any place where the internal variable could be comprimised. Memory leaks or problems like it could make sense, but we&amp;#39;ve got multiple devices reporting the same behaviour, and the datetime, while now a month off, is still consistent with the passing of time, but with an offset. I&amp;#39;d expect that memory issues would be lead to more random outcomes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Date Time Desync Issue</title><link>https://devzone.nordicsemi.com/thread/319869?ContentTypeID=1</link><pubDate>Tue, 13 Jul 2021 14:52:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16b4a85d-7320-4789-ac2b-313ceb9ebbbd</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What time sources are you getting your time from?&lt;/p&gt;
&lt;p&gt;What date_time related Kconfig options have you set, and how do you use the library in your code?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Do you have any insight as to what could cause our clock to skip forward like that, or why the date_time_update_async calls would not correct the error?[/quote]
&lt;p&gt;&amp;nbsp;In general, memory leaks, or other memory related errors could cause all kind of weird behavior. Could it be possible that there is something else than the date_time library that writes to the date_time library&amp;#39;s internal variable?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Didrik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>