<?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>about system time</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72079/about-system-time</link><description>hello, 
 i am using sdk 16 with nrf52832 is it possible to print system time using nrf log? 
 
 thanks and regards 
 manikandan v</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Feb 2021 11:12:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72079/about-system-time" /><item><title>RE: about system time</title><link>https://devzone.nordicsemi.com/thread/296494?ContentTypeID=1</link><pubDate>Fri, 26 Feb 2021 11:12:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8105fcd9-34b0-4f23-a8d8-751cb863e3e5</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I agree with &lt;a href="https://devzone.nordicsemi.com/members/awneil"&gt;awneil&lt;/a&gt; that this is not straight forward, depending on what you intend to use it for.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you intend to use it only for logging, there is actually a built in module. You can see how it is set up in the example found in any of the examples that doesn&amp;#39;t use NRF_LOG_INIT(NULL). As far as I can tell, that are these:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ble_central_and_peripheral/experimental/ble_app_att_mtu_throughput
/ble_central_and_peripheral/experimental/ble_app_interactive/main.c
/ble_peripheral/experimental/ble_app_cli
/crypto/ifx_optiga_custom_example
/peripheral/cli
/peripheral/libuarte/main.c
/peripheral/radio_test
/peripheral/usbd_msc
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I would recommend checking out the peripheral\cli example, if any of these.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Other than that, you can use the app_timer, and the function app_timer_cnt_get() to get the timestamp of the RTC (real time counter). This is not &amp;quot;synchronized with the world&amp;quot; as an RTC (Real Time Clock), as awneil said.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You would need to translate from the number of ticks to readable time, which depends on the RTC&amp;#39;s prescaler.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: about system time</title><link>https://devzone.nordicsemi.com/thread/296463?ContentTypeID=1</link><pubDate>Fri, 26 Feb 2021 09:40:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9654835-6ef3-412b-9c34-9757b1eafc72</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Remember that this is an embedded microcontroller system - it has no knowledge of &amp;quot;system time&amp;quot; unless you provide the code to do it.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;(if you&amp;#39;re not familiar with&amp;nbsp;embedded microcontroller systems, nRF52 is probably not a good place to start)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You will probably want to use the internal RTC (Real Time Counter):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/rtc.html?cp=4_2_0_24#concept_rvn_vkj_sr"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/rtc.html?cp=4_2_0_24#concept_rvn_vkj_sr&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you want &amp;quot;human readable&amp;quot; time (year, month, day, hour, minute) you might use an external RTC (Real Time Clock).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you want&amp;nbsp;your &amp;quot;system time&amp;quot; to be synchronised to time in the Real World, then you will also have to implement some means to set the time - search the forum for &amp;quot;Current Time Service&amp;quot; aka &amp;quot;CTC&amp;quot;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: about system time</title><link>https://devzone.nordicsemi.com/thread/296400?ContentTypeID=1</link><pubDate>Fri, 26 Feb 2021 00:44:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e741a747-d083-45a6-8a4c-d194abcd849a</guid><dc:creator>manikandan</dc:creator><description>&lt;p&gt;thanks for your reply yes how can i obtain the system time??&lt;/p&gt;
&lt;p&gt;thanks and regards&amp;nbsp;&lt;/p&gt;
&lt;p&gt;manikandan v&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: about system time</title><link>https://devzone.nordicsemi.com/thread/296399?ContentTypeID=1</link><pubDate>Fri, 26 Feb 2021 00:36:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27ff7a39-cf32-4364-baeb-b5587d2bd98f</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Not quite sure wht you&amp;#39;e after here?&lt;/p&gt;
&lt;p&gt;It&amp;#39;s just a number - so can be &amp;quot;printed&amp;quot; like any other number?&lt;/p&gt;
&lt;p&gt;Or is the question actually how to obtain &amp;quot;system time&amp;quot; ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>