<?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>how do I get time and time zone information</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61441/how-do-i-get-time-and-time-zone-information</link><description>I am trying to get the current time and the current time zone. I see there is some modem commands LWM2M commands that appear to have the capability to do that. When I try to create the sample LWM2M client program it crashes. I do do even get to the point</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 May 2020 23:51:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61441/how-do-i-get-time-and-time-zone-information" /><item><title>RE: how do I get time and time zone information</title><link>https://devzone.nordicsemi.com/thread/250554?ContentTypeID=1</link><pubDate>Mon, 18 May 2020 23:51:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de1c158f-c447-41be-8df7-682e7e3f0d33</guid><dc:creator>Timothy</dc:creator><description>&lt;p&gt;Didrik&lt;/p&gt;
&lt;p&gt;yes that worked. I can get the information from the modem. this can be closed. Thank you very much.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how do I get time and time zone information</title><link>https://devzone.nordicsemi.com/thread/250495?ContentTypeID=1</link><pubDate>Mon, 18 May 2020 14:50:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6db882b4-52e9-4c9f-b124-81108fb5b9ba</guid><dc:creator>Didrik Rokhaug</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]When I try to create the sample LWM2M client program it crashes. I do do even get to the point where it loads and I can build it.[/quote]
&lt;p&gt;&amp;nbsp;What errors do you get? Which NCS version? What board are you trying to build for? Did you select the non-secure version?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]I am trying to get the current time and the current time zone.[/quote]
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]is LWM2M the right tool to use and if so how do I use it?[/quote]
&lt;p&gt;&amp;nbsp;I am not very experienced with LwM2M myself yet, but there does seem to be objects that can be used to provide the time and timezone.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Are there any examples that show how to get the current time and time zone[/quote]
&lt;p&gt;No official ones, no.&lt;/p&gt;
&lt;p&gt;One of my collegues created an SNTP sample, but it has not been updated in a long time: &lt;a href="https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/ntp"&gt;https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/ntp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Instead, I recommend you take a look at the date_time library on the master branch: &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/include/date_time.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/include/date_time.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It will use periodic NTP queries to get the time, but it can also be configured to get the (network) time from the modem using AT commands: &lt;a href="https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/mob_termination_ctrl_status/cclk.html"&gt;https://infocenter.nordicsemi.com/topic/ref_at_commands/REF/at_commands/mob_termination_ctrl_status/cclk.html&lt;/a&gt;&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>