<?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>Current time on Thingy 91</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/55587/current-time-on-thingy-91</link><description>Hi, 
 I want to get current time for thingy91 in asset_tracker application. 
 Could someone please provide me a sample or hint on how to get it.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Dec 2019 11:47:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/55587/current-time-on-thingy-91" /><item><title>RE: Current time on Thingy 91</title><link>https://devzone.nordicsemi.com/thread/225607?ContentTypeID=1</link><pubDate>Mon, 16 Dec 2019 11:47:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba78404c-5535-4de2-adb3-8307de315460</guid><dc:creator>&amp;#216;yvind</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;My apologies for the late reply.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You can read the time using the AT command:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/mob_termination_ctrl_status/cclk_read.html"&gt;AT+CCLK?&lt;/a&gt;&amp;nbsp;In your AT_CLIENT, simply enter this command to get the output as described in link.&lt;br /&gt;&lt;br /&gt;To use the AT command in i.e. asset tracker, please add the following after modem_configure() (line 1015) in&amp;nbsp;nrf\applications\asset_tracker\src\main.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;	k_sleep(1*1000);
	ret = at_cmd_write(ATcmd, response, sizeof(response), NULL);
	if (ret == 0)
		printk(&amp;quot;%s\n&amp;quot;, response);
	else
	{
		printk(&amp;quot;CCLK err: %d\n&amp;quot;, ret);
	}
	&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Where k_sleep is a delay to ensure that your application is connected to LTE network, i.e. ensure that you get CEREG:&amp;nbsp;&lt;span&gt;5 – Registered, roaming before calling CCLK.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Here is my output&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;2019-12-16T11:46:46.018Z DEBUG modem &amp;lt;&amp;lt; Connecting to LTE network. This may take several minutes.
2019-12-16T11:46:47.378Z DEBUG modem &amp;lt;&amp;lt; +CEREG: 2,&amp;quot;76C1&amp;quot;,&amp;quot;014ACE00&amp;quot;,7,0,0,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
2019-12-16T11:46:47.438Z DEBUG modem &amp;lt;&amp;lt; 
2019-12-16T11:46:48.364Z DEBUG modem &amp;lt;&amp;lt; +CEREG: 5,&amp;quot;76C1&amp;quot;,&amp;quot;014ACE00&amp;quot;,7,,,&amp;quot;11100000&amp;quot;,&amp;quot;11100000&amp;quot;
2019-12-16T11:46:48.426Z DEBUG modem &amp;lt;&amp;lt; Connected to LTE network
2019-12-16T11:46:49.371Z DEBUG modem &amp;lt;&amp;lt; +CCLK: &amp;quot;19/12/16,11:46:33+04&amp;quot;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Kind regards,&lt;br /&gt;Øyvind&lt;/span&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>