From 61138ed12d214393ba04348e5810a3523add4b45 Mon Sep 17 00:00:00 2001 From: woochan lee Date: Tue, 2 Feb 2016 10:28:46 +0900 Subject: [PATCH] [3.0][online-doc] Add datetime value usage example. Signed-off-by: woochan lee Change-Id: If6cf620438d3454032992106099374cf8dd6634e --- .../html/native/efl/component_datetime_mn.htm | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/org.tizen.ui.practices/html/native/efl/component_datetime_mn.htm b/org.tizen.ui.practices/html/native/efl/component_datetime_mn.htm index fc1d4a3..c017a57 100644 --- a/org.tizen.ui.practices/html/native/efl/component_datetime_mn.htm +++ b/org.tizen.ui.practices/html/native/efl/component_datetime_mn.htm @@ -135,6 +135,30 @@ elm_datetime_format_set(datetime, "%d%B%Y");

For a complete list of available specifiers, see the Datetime API.

+

Using the Datetime Value

+ +

The value of the date and time can be set/get with elm_datetime_value_set()

and elm_datetime_value_get() using a tm struct and related time APIs.

+ +

In the following example the datetime value set a time in current locale.

+ +
+time_t local_time = time(NULL);
+struct tm *time_tm = localtime(&local_time);
+struct tm t = *time_tm;
+
+elm_datetime_value_set(datetime, &t);
+
+ +

In the following example the datetime value get and print current date.

+ +
+struct tm t;
+
+elm_datetime_value_get(datetime, &t);
+
+printf("%d %d %d", t.tm_mday, t.tm_mon, t.tm_year);
+
+

Using the Datetime Callbacks

To receive notifications about the datetime events, listen to the following signals:

-- 2.7.4