<?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>auto update of time</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83446/auto-update-of-time</link><description>Hi all, 
 i&amp;#39;am sending epoch time for example 1641533394 from mobile to nrf52840dk only once ,then i need to update it continuously 
 so i tried the below link which gets build and flash ,but i want to know in which api i can set epoch value and get the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Jan 2022 14:32:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83446/auto-update-of-time" /><item><title>RE: auto update of time</title><link>https://devzone.nordicsemi.com/thread/346727?ContentTypeID=1</link><pubDate>Fri, 07 Jan 2022 14:32:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d236d2be-e98d-47be-8c86-1b2db264bdb0</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The time API of the exaqmple is found in &lt;a href="https://github.com/NordicPlayground/nrf5-calendar-example/blob/master/nrf_calendar.h"&gt;nrf_calendar.h&lt;/a&gt;. The function for setting the time is nrf_cal_set_time(), and the function for getting the time is nrf_cal_get_time(). The former takes in integers for year, month, day, hour, minute and second, so for that you need to convert from epoch to those values. The latter returns a tm struct from the standard library time.h, which has integer fields tm_sec, tm_min, tm_hour, tm_mday, tm_mon, tm_year, tm_wday, tm_yday and tm_isdst as defined e.g. at &lt;a href="https://www.tutorialspoint.com/c_standard_library/time_h.htm"&gt;https://www.tutorialspoint.com/c_standard_library/time_h.htm&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>