[3.0][online-doc] Add datetime value usage example.
authorwoochan lee <wc0917.lee@samsung.com>
Tue, 2 Feb 2016 01:28:46 +0000 (10:28 +0900)
committerwoochan lee <wc0917.lee@samsung.com>
Tue, 2 Feb 2016 01:29:26 +0000 (10:29 +0900)
Signed-off-by: woochan lee <wc0917.lee@samsung.com>
Change-Id: If6cf620438d3454032992106099374cf8dd6634e

org.tizen.ui.practices/html/native/efl/component_datetime_mn.htm

index fc1d4a3..c017a57 100644 (file)
@@ -135,6 +135,30 @@ elm_datetime_format_set(datetime, &quot;%d%B%Y&quot;);
 
 <p>For a complete list of available specifiers, see the <a href="../../../../org.tizen.native.mobile.apireference/group__Datetime.html">Datetime</a> API.</p>
 
+<h2 id="set">Using the Datetime Value</h2>
+
+<p>The value of the date and time can be set/get with <span style="font-family: Courier New,Courier,monospace">elm_datetime_value_set()</span></p> and <span style="font-family: Courier New,Courier,monospace">elm_datetime_value_get()</span> using a tm struct and related time APIs.</p>
+
+<p>In the following example the datetime value set a time in current locale.</p>
+
+<pre class="prettyprint">
+time_t local_time = time(NULL);
+struct tm *time_tm = localtime(&local_time);
+struct tm t = *time_tm;
+
+elm_datetime_value_set(datetime, &t);
+</pre>
+
+<p>In the following example the datetime value get and print current date.</p>
+
+<pre class="prettyprint">
+struct tm t;
+
+elm_datetime_value_get(datetime, &t);
+
+printf(&quot;%d %d %d&quot;, t.tm_mday, t.tm_mon, t.tm_year);
+</pre>
+
 <h2 id="callback">Using the Datetime Callbacks</h2>
 
 <p>To receive notifications about the datetime events, listen to the following signals:</p>