<?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>Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/74367/get-the-lib-time-in-the-thingy-91</link><description>Hello, 
 
 I&amp;#39;m coming to you with a beginner question, I would like to use the functions localtime, difftime, strftime but I saw that time.h is not included. Is it possible to get it or to do the same thing as these functions? I tried including NEWLIB</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 May 2021 07:59:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/74367/get-the-lib-time-in-the-thingy-91" /><item><title>RE: Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/thread/311339?ContentTypeID=1</link><pubDate>Tue, 25 May 2021 07:59:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c880b114-0bc1-446b-a83e-8a2b917dbece</guid><dc:creator>ActiTAG</dc:creator><description>&lt;p&gt;It was my fault sorry, I have printed the hex value not the decimal and when I&amp;nbsp;saw the decimal it was the good one. Thanks for your time and help It&amp;#39;s working well !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/thread/310671?ContentTypeID=1</link><pubDate>Thu, 20 May 2021 09:49:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67a151bf-3917-43ca-a9d6-804e3559629e</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="ActiTAG"]thank you for your answer!&amp;nbsp;[/quote]
&lt;p&gt;No problem at all, I am happy to help!&lt;/p&gt;
[quote user="ActiTAG"]&lt;p&gt;Yes, I know but even if I&amp;#39;m waiting for the update of the date_time (so 60 and 1800s), I received those printed values (&lt;span&gt;00000179fae6436e / 00000179fb00561a). I used a site to convert it to a readable value ( I don&amp;#39;t want to convert it in my code, it&amp;#39;s not necessary).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;From what I see, I have never received&amp;nbsp;the network time and date. Maybe I forget to add something? I made the same as this topic :&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/66410/nrf9160-date-time-example"&gt;nRF9160 date-time example - Nordic Q&amp;amp;A - Nordic DevZone - Nordic DevZone (nordicsemi.com)&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Are you checking the return value of &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/include/date_time.html#c.date_time_now"&gt;&lt;em&gt;date_time_now&lt;/em&gt;&lt;/a&gt;? Is it successful?&lt;br /&gt;The function will return an error if it does not have a valid timestamp, or if it fails for another reason.&lt;br /&gt;Please also make a call to&amp;nbsp;&lt;em&gt;date_time_is_valid&amp;nbsp;&lt;/em&gt;before starting your other date-time operations, to check that the library has successfully received a valid initial timestamp.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/thread/310446?ContentTypeID=1</link><pubDate>Wed, 19 May 2021 12:42:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:658c361d-17bf-46fb-8e57-b1ed0ba6d2c0</guid><dc:creator>ActiTAG</dc:creator><description>&lt;p&gt;Hello, thank you for your answer!&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/74367/get-the-lib-time-in-the-thingy-91/310373#310373"]It only configures how often the date time is updated, in seconds, so it does not affect the current date time value.&amp;nbsp;[/quote]
&lt;p&gt;Yes, I know but even if I&amp;#39;m waiting for the update of the date_time (so 60 and 1800s), I received those printed values (&lt;span&gt;00000179fae6436e / 00000179fb00561a). I used a site to convert it to a readable value ( I don&amp;#39;t want to convert it in my code, it&amp;#39;s not necessary).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;From what I see, I have never received&amp;nbsp;the network time and date. Maybe I forget to add something? I made the same as this topic :&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/66410/nrf9160-date-time-example"&gt;nRF9160 date-time example - Nordic Q&amp;amp;A - Nordic DevZone - Nordic DevZone (nordicsemi.com)&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you have an idea I would be glad to hear it!&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind Regards,&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/thread/310373?ContentTypeID=1</link><pubDate>Wed, 19 May 2021 09:57:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:067c58b9-4ad1-46a8-a813-050c9ae801b6</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Thank you for your patience.&amp;nbsp;&lt;/p&gt;
[quote user="ActiTAG"]Humm I set the value to 60 and 1800[/quote]
&lt;p&gt;Are you referring to the&amp;nbsp;&lt;span&gt;CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS&amp;nbsp;value?&lt;br /&gt;&lt;/span&gt;It only configures how often the date time is updated, in seconds, so it does not affect the current date time value.&amp;nbsp;&lt;/p&gt;
[quote user="ActiTAG"]00000179fae6436e / 00000179fb00561a (Mon Jul 27 1970 19:05:45 GMT+0000)&amp;nbsp;...[/quote]
&lt;p&gt;Is this immediately upon starting your device, or is it after having received the network time and date? How did you print out and convert these values to the Jul 27 1970 date?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/thread/309289?ContentTypeID=1</link><pubDate>Tue, 11 May 2021 14:22:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e3301b2-232e-473c-bf13-aadec7099064</guid><dc:creator>ActiTAG</dc:creator><description>&lt;p&gt;Humm I set the value to 60 and 1800 but the date time get is&amp;nbsp;&lt;span&gt;00000179fae6436e / 00000179fb00561a (Mon Jul 27 1970 19:05:45 GMT+0000)&amp;nbsp;...&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/thread/309153?ContentTypeID=1</link><pubDate>Tue, 11 May 2021 08:57:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ff5ebba-58bc-4e4b-a16e-38434cc40b43</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="ActiTAG"]I hope you&amp;#39;re fine.[/quote]
&lt;p&gt;Thank you, I hope you are as well!&lt;/p&gt;
[quote user="ActiTAG"]Yes but my problem is that I need to set it. In my case, I would like to have the network time to know when the thingy is running and set it automatically, to after using a timer to continue to have the time up to date.&amp;nbsp;[/quote]
&lt;p&gt;Yes, but if I understand you correctly, you shouldnt have to query the network for its time every second (as indicated by the&amp;nbsp;CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS config - but instead query it more seldom, and keep track of it locally using a timer.&lt;br /&gt;Does this make sense? Then you would just have to query for the network time every so often, to negate the timer&amp;#39;s drift over time.&lt;/p&gt;
[quote user="ActiTAG"]I&amp;#39;ll have a look with datetime lib by increasing it[/quote]
&lt;p&gt;My suggestion was to try increasing the&amp;nbsp;CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS config, if you started to receive your error after setting it to 1, in order to pinpoint that this configuration was indeed the issue.&lt;/p&gt;
[quote user="ActiTAG"]I&amp;#39;ll keep you informed. :)[/quote]
&lt;p&gt;Alright, sounds good to me! :)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/thread/309047?ContentTypeID=1</link><pubDate>Mon, 10 May 2021 15:28:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:85b37c08-4ed8-4457-90d1-1758680b8bfb</guid><dc:creator>ActiTAG</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I hope you&amp;#39;re fine.&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/74367/get-the-lib-time-in-the-thingy-91/309034#309034"]&lt;blockquote class="quote"&gt;&lt;div class="quote-user"&gt;ActiTAG said:&lt;/div&gt;&lt;div class="quote-content"&gt;Yes, I have checked that. I ran the at_client sample and it works if I set the clock with AT+CCLCK=&amp;quot;xxxx&amp;quot;.&lt;/div&gt;&lt;/blockquote&gt;&lt;div class="quote-footer"&gt;&lt;/div&gt;
&lt;p&gt;Great, I am glad to hear that this works, at least.&amp;nbsp;&lt;/p&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Yes but my problem is that I need to set it. In my case, I would like to have the network time to know when the thingy is running and set it automatically, to after using a timer to continue to have the time up to date.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll have a look with datetime lib by increasing it, I&amp;#39;ll keep you informed. :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/thread/309034?ContentTypeID=1</link><pubDate>Mon, 10 May 2021 14:48:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f66ebf4-334a-4421-bcf4-559bdd13bbe5</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="ActiTAG"]Yes, I have checked that. I ran the at_client sample and it works if I set the clock with AT+CCLCK=&amp;quot;xxxx&amp;quot;.[/quote]
&lt;p&gt;Great, I am glad to hear that this works, at least.&amp;nbsp;&lt;/p&gt;
[quote user="ActiTAG"]I&amp;#39;m using a prepaid SIM card 1NCE, I&amp;#39;m connecting to de DeutschTelekom network but I don&amp;#39;t find any information to know if they provide network time.[/quote]
&lt;p&gt;To officially confirm whether they do provide this or not you would unfortunately have &lt;a href="https://www.telekom.com/en/investor-relations/service/contact"&gt;to contact and inquire them directly&lt;/a&gt;, but since the at_client is able to get the network time it is safe to say that they do, so this should not be the issue here.&lt;/p&gt;
[quote user="ActiTAG"]I&amp;#39;ve never had a problem before but I noticed it when I added this line[/quote][quote user="ActiTAG"]But I have no idea how to fix the problem.&amp;nbsp;Maybe you have already encountered this problem?[/quote]
&lt;p&gt;Is your intention for this modification to have the modem query the network time every second?&lt;br /&gt;The default value for this is 3600, so setting it to 1 might be too low - i.e you might be inquiring about this too often, and thus fail.&lt;br /&gt;Could you try to set this a little higher, and see if you still see this issue?&lt;br /&gt;What accuracy do you need for your time synchronization? The onboard timers should provide enough accuracy so that you do not have to query the network so often, to know the network time.&lt;/p&gt;
[quote user="ActiTAG"]Thank you for your help and suggestions on how to get what I am looking for.&amp;nbsp;[/quote]
&lt;p&gt;No problem, I am happy to help!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/thread/308387?ContentTypeID=1</link><pubDate>Wed, 05 May 2021 14:35:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f33ca9b4-f606-472d-b5b2-86c165eaa362</guid><dc:creator>ActiTAG</dc:creator><description>&lt;p&gt;Hello !&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/74367/get-the-lib-time-in-the-thingy-91/308338#308338"]The specific -5 error is I/O Error, and could be generated if the IO has not been initialized. Have you made sure to run modem_info_init prior to the command?[/quote]
&lt;p&gt;Yes, I have checked that. I ran the at_client sample and it works if I set the clock with AT+CCLCK=&amp;quot;xxxx&amp;quot;.&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/74367/get-the-lib-time-in-the-thingy-91/308338#308338"]Have you also ensured that the network actually provides the network time? I recently spoke to a colleague that told me that there exists some that do not always provide this.[/quote]
&lt;p&gt;I&amp;#39;m using a prepaid SIM card 1NCE, I&amp;#39;m connecting to de DeutschTelekom network but I don&amp;#39;t find any information to know if they provide network time.&amp;nbsp;&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/74367/get-the-lib-time-in-the-thingy-91/308338#308338"]Could you try using &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/include/date_time.html?highlight=date%20time"&gt;the Date Time library&lt;/a&gt; for retrieving the timestamp instead?&lt;br /&gt;The Date Time library checks more thoroughly for available system time.[/quote]
&lt;p&gt;I was guided by this post&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/66410/nrf9160-date-time-example"&gt;nRF9160 date-time example - Nordic Q&amp;amp;A - Nordic DevZone - Nordic DevZone (nordicsemi.com)&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#prj.conf
CONFIG_DATE_TIME=y
CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS=1
CONFIG_LEGACY_TIMEOUT_API=y

#main.c

struct tm now = {0};
now.tm_hour = 13;   now.tm_min = 06; now.tm_sec = 00;
now.tm_year = 121; now.tm_mon = 05; now.tm_mday = 05; 
err = date_time_set(&amp;amp;now);

...
      
int64_t date_time_stamp;
k_sleep(K_MSEC(25000)); //Wait some time to make sure the Date-Time update has happened
date_time_now(&amp;amp;date_time_stamp); 
printk(&amp;quot;Date time: %016llX\n&amp;quot;, date_time_stamp);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But now I have a problem with the lte_lc lib when I do :&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;err = lte_lc_init_and_connect();&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve never had a problem before but I noticed it when I added this line ( :&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS=1&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But I have no idea how to fix the problem.&amp;nbsp;Maybe you have already encountered this problem?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;[00:00:01.241,760] [1;33m&amp;lt;wrn&amp;gt; at_notif: Already initialized. Nothing to do[0m
[00:00:01.257,904] [0m&amp;lt;inf&amp;gt; lte_lc: PDP Context: AT+CGDCONT=0,&amp;quot;IP&amp;quot;,&amp;quot;iot.1nce.net&amp;quot;[0m
[00:00:02.242,248] [1;33m&amp;lt;wrn&amp;gt; date_time: getaddrinfo, error: -11[0m
[00:00:02.242,401] [1;33m&amp;lt;wrn&amp;gt; date_time: getaddrinfo, error: -11[0m
[00:00:02.242,584] [1;33m&amp;lt;wrn&amp;gt; date_time: getaddrinfo, error: -11[0m
[00:00:02.242,767] [1;33m&amp;lt;wrn&amp;gt; date_time: getaddrinfo, error: -11[0m
[00:00:02.242,980] [1;33m&amp;lt;wrn&amp;gt; date_time: getaddrinfo, error: -11
[0m[00:00:02.242,980] [1;33m&amp;lt;wrn&amp;gt; date_time: Not getting time from any NTP server&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your help and suggestions on how to get what I am looking for.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/thread/308338?ContentTypeID=1</link><pubDate>Wed, 05 May 2021 11:54:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63769f6e-3231-4dea-9543-10cc64db785e</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="ActiTAG"]Oh you&amp;#39;re right, I should have thought to check the return of the function! It&amp;#39;s return -5.&amp;nbsp;[/quote]
&lt;p&gt;Hehe, yes, it is always good to check the return value of the function. In this case, it returned a negative number which means an error occurred - this is very helpful for us to know!&lt;br /&gt;The specific -5 error is I/O Error, and could be generated if the IO has not been initialized. Have you made sure to run modem_info_init prior to the command?&lt;/p&gt;
&lt;p&gt;Could you try using &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/include/date_time.html?highlight=date%20time"&gt;the Date Time library&lt;/a&gt; for retrieving the timestamp instead?&lt;br /&gt;The Date Time library checks more thoroughly for available system time.&lt;br /&gt;Have you also ensured that the network actually provides the network time? I recently spoke to a colleague that told me that there exists some that do not always provide this.&lt;/p&gt;
[quote user="ActiTAG"]&lt;p&gt;I have something in recv_buf and no error.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have an idea please ?&amp;nbsp;&lt;/p&gt;[/quote]
&lt;p&gt;It sounds strange to me that you get the error when calling date time but not when calling for recv info.&lt;/p&gt;
[quote user="ActiTAG"]Have a nice day[/quote]
&lt;p&gt;Thank you for saying that, I hope you have a nice day as well! :)&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/thread/307952?ContentTypeID=1</link><pubDate>Mon, 03 May 2021 13:24:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a2ee30d-769a-4664-a9aa-b94a7baa7b17</guid><dc:creator>ActiTAG</dc:creator><description>&lt;p&gt;Oh you&amp;#39;re right, I should have thought to check the return of the function! It&amp;#39;s return -5.&amp;nbsp; With the debugger I see that in the lib modem_info line 482&amp;nbsp; the response&amp;nbsp;in recv_buf is empty.&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;err = at_cmd_write(modem_data[info]-&amp;gt;cmd,
			  recv_buf,
			  CONFIG_MODEM_INFO_BUFFER_SIZE,
			  NULL);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But when I made&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;modem_info_string_get(MODEM_INFO_RSRP, buf_rsrp, MODEM_INFO_JSON_STRING_SIZE);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I have something in recv_buf and no error.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have an idea please ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have a nice day &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f603.svg" title="Smiley"&gt;&amp;#x1f603;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/thread/307846?ContentTypeID=1</link><pubDate>Mon, 03 May 2021 08:30:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecf77a0f-0eff-4832-b2b9-3c4e512933c5</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="ActiTAG"]Thank you for your answer, I understand better![/quote]
&lt;p&gt;Great, I am happy to hear that! :)&amp;nbsp;&lt;/p&gt;
[quote user="ActiTAG"]However, I can&amp;#39;t read the result. There would be something that I missed? thank you in advance for your time ;) ![/quote]
&lt;p&gt;What happens when you run the code snippet above? What is printed to your logger?&lt;br /&gt;Please check the returned value of the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/include/modem/modem_info.html#c.modem_info_string_get"&gt;modem_info_string_get&lt;/a&gt; call, it will return the length of the received data if the call was successful - or a negative error code if the call failed.&lt;br /&gt;Please check this, and let me know what modem_info_string_get returns.&lt;br /&gt;&lt;br /&gt;On a general note, you should always make sure to check the returned values and error codes from your functions if there are any, as this is your only indication whether the function call succeeded or not.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/thread/307515?ContentTypeID=1</link><pubDate>Thu, 29 Apr 2021 13:45:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa46e1e5-5d3e-451e-b2fb-a717b2474ef1</guid><dc:creator>ActiTAG</dc:creator><description>&lt;p&gt;Hello !&lt;/p&gt;
&lt;p&gt;Thank you for your answer, I understand better! I would like to recover the timestamp network which must be the &lt;a href="https://www.unixtimestamp.com/"&gt;gmtime&lt;/a&gt;, I use this command:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;char buf_time[MODEM_INFO_JSON_STRING_SIZE];
modem_info_string_get(MODEM_INFO_DATE_TIME, buf_time, MODEM_INFO_JSON_STRING_SIZE);
printk(&amp;quot;%s\n&amp;quot;,buf_time);
double diff_t = atoi(payload_buf) - atoi(buf_time);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However, I can&amp;#39;t read the result. There would be something that I missed? thank you in advance for your time ;) !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get the lib time in the thingy 91</title><link>https://devzone.nordicsemi.com/thread/306585?ContentTypeID=1</link><pubDate>Fri, 23 Apr 2021 15:04:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48bf4dd9-e1a2-4ad5-976e-8104439a5ecf</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]I&amp;#39;m coming to you with a beginner question[/quote]
&lt;p&gt;No problem at all, we are happy to help with any question you might have!&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
[quote user=""]&lt;p&gt;I would like to use the functions localtime, difftime, strftime but I saw that time.h is not included. Is it possible to get it or to do the same thing as these functions? I tried including NEWLIB but there is no time lib.&lt;/p&gt;
&lt;p&gt;In my project I&amp;nbsp;get a timestamp and I would like to have the difference of time elapsed between this timestamp and the timestamp of now.&lt;/p&gt;[/quote]
&lt;p&gt;When you say that you need a timestamp, do you mean a timestamp from the network, or a RTC counting locally on your device? As in, do you need the timestamp to be the actual current time, which is used in the network?&lt;br /&gt;Or, do you just need to see how long time has elapsed since the previous timestamp, with no regards to what the time actually is in the network?&lt;br /&gt;In the first case, &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/51934/getting-network-time-in-nrf91"&gt;where you need the network time, please see the answer by my colleague in this ticket&lt;/a&gt;.&lt;br /&gt;In the latter case, where you just need to see how long time has passed since last, you can use &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf9160%2Frtc.html"&gt;the nRF9160&amp;#39;s RTC peripheral&lt;/a&gt;&amp;nbsp;directly.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Please do not hesitate to let me know if any part of my answer is unclear, or if you should have any other issues or questions!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>