Date Time policy group provides policies for date time control.
More...
Date Time policy group provides policies for date time control.
Date Time policy group.
Required Header
#include <mdm.h>
Overview
This group provides APIs to control the various settings related to device date and time. This includes disabling and enabling, making configurations and querying the current date and time settings.
API to get whether automatic time updates using Network Identity and Time Zone (NITZ) is enabled.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.1.5
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin can check if automatic time is enabled on the device. If so, the device uses Network Identity and Time Zone (NITZ) to update its time and date.
int value = 0;
printf("time %d", value);
}
- Parameters
-
[out] | p_value | Whether NITZ is enabled. Valid values are '1' for enabled or '0' for disabled. |
- Returns
- mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
- Return values
-
- See also
- mdm_set_automatic_time()
API to get the date format.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.1.5
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin can get the current date set on the device as: DD/MM/YYYY, MM/DD/YYYY, or YYYY/MM/DD.
if (lp_data) {
char *temp = (
char *)lp_data->
data;
if (temp) {
printf("format : %s", temp);
}
}
- Returns
- The date format on success. Otherwise. returns NULL.
- See also
- mdm_set_date_format()
API to get the date and time.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.1.5
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin gets the current date and time set on the device. Date time is returned in one of the following custom formats: ddd MMM dd HH:mm 'GMT' zzz yyyy or ddd MMM dd h:mm tt 'GMT' zzz yyyy. For example: Wed Nov 18 7:40 PM GMT +9:00 2014.
if (lp_data) {
char *temp = (
char *)lp_data->
data;
if (temp) {
printf("date time : %s", temp);
}
}
- Returns
- The current data and time on success. Otherwise, returns NULL.
- See also
- mdm_set_date_time()
API to get the daylight saving time state.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.1.5
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin can get the current daylight saving time state of the device. This is whether the device is currently in a timeZone with Daylight Saving Time.
int value = 0;
printf("time %d", value);
}
- Parameters
-
[out] | p_value | Whether the device is in a timeZone that uses Daylight Savings Time. The value is positive if daylight saving time is in effect, zero if it is not, and negative if the information is not available. |
- Returns
- mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
- Return values
-
- See also
- mdm_get_time_zone(), mdm_set_time_zone()
API to get the device time.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.1.5
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin can get the current device time. This is either in 12h or 24h format, which can be set by
mdm_set_time_format()
.
if (lp_data) {
char *temp = (
char *)lp_data->
data;
if (temp) {
printf("time : %s", temp);
}
}
- Returns
- The device time on success. Otherwise, returns NULL.
- See also
- mdm_set_time_format()
API to get the device time zone as a valid ID.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.1.5
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin can get the current timeZone set on the device. For example, America/Denver. DateTimeSettings in the device's Settings application lists the possible timeZone values.
if (lp_data) {
char *temp = (
char *)lp_data->
data;
if (temp) {
printf("timezone : %s", temp);
}
}
- Returns
- The timeZone of the device on success. Otherwise, returns NULL.
- See also
- mdm_set_time_zone()
API to check whether the user can change the date and time.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin can check whether the Date Time Change policy is enabled. By default, the policy is enabled.
- Returns
- mdm_status_t : Whether the user can change the date and time
- Return values
-
- See also
- mdm_set_date_time_change_enabled()
API to set whether to use automatic time updates using Network Identity and Time Zone (NITZ).
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin can enable the use of NITZ (Network Identity and Time Zone) on the device.
- Privilege Level:
- public
- Privilege:
- http://developer.samsung.com/tizen/privilege/mdm.datetime
- Parameters
-
[in] | enabled | Determines whether to enable or disable automatic time updates using NITZ. Use MDM_TRUE to enable NITZ, or use MDM_FALSE to disable NITZ. |
- Returns
- mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
- Return values
-
- Permission:
- This API is restricted to registered clients only.
- See also
- mdm_get_automatic_time()
API to set the device date format.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin can set the device date format on the device
- Privilege Level:
- public
- Privilege:
- http://developer.samsung.com/tizen/privilege/mdm.datetime
- Parameters
-
[in] | p_format | The date format to set. Acceptable values are: DD/MM/YYYY, MM/DD/YYYY, or YYYY/MM/DD. |
- Returns
- mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
- Return values
-
- Permission:
- This API is restricted to registered clients only.
- See also
- mdm_get_date_format()
mdm_result_t mdm_set_date_time |
( |
int |
day, |
|
|
int |
month, |
|
|
int |
year, |
|
|
int |
hour, |
|
|
int |
minute, |
|
|
int |
second |
|
) |
| |
API to set the device date and time.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin can provide date parameters to set the date and time of the device.
int day = 23, month = 12, year = 2013, hour = 1, minute = 10, second = 20;
} else {
}
- Privilege Level:
- public
- Privilege:
- http://developer.samsung.com/tizen/privilege/mdm.datetime
- Parameters
-
[in] | day | Day of month to which the device date is to be set. |
[in] | month | Month to which the device date is to be set. |
[in] | year | Year to which the device date is to be set. |
[in] | hour | Hour of day to which the device time is to be set. |
[in] | minute | Minute to which the device time is to be set. |
[in] | second | Second to which the device time is to be set. |
- Returns
- mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
- Return values
-
- Permission:
- This API is restricted to registered clients only.
- Attention
- Automatic time option, has a higher priority!
- See also
- mdm_get_date_time()
-
mdm_set_automatic_time()
mdm_result_t mdm_set_date_time_change_enabled |
( |
bool |
enabled | ) |
|
API to set whether the user can change the date and time.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin can use this API to control the user's access to the Date Time Setting. Call this function with
enabled
set to true
to allow the user to change the date and time, or use false
to disable this ability.
- Privilege Level:
- public
- Privilege:
- http://developer.samsung.com/tizen/privilege/mdm.datetime
- Parameters
-
[in] | enabled | The status of the policy. Use true to enable the policy or false to disable the policy. |
- Returns
- mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
- Return values
-
- Permission:
- This API is restricted to registered clients only.
- See also
- mdm_is_date_time_change_enabled()
API to set the device time format.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin can set the device time format to 12h or 24h. For example, 3:17 PM is 3:17 in 12h format, and 15:17 in 24h format.
- Privilege Level:
- public
- Privilege:
- http://developer.samsung.com/tizen/privilege/mdm.datetime
- Parameters
-
[in] | p_format | The time format to use. Use "12" for 12h format, or "24" for 24h format. |
- Returns
- mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
- Return values
-
- Permission:
- This API is restricted to registered clients only.
- See also
- mdm_get_time_format()
API to set the device TimeZone.
- Since (Knox_wearable):
- 1.0.0
- Since (Tizen):
- 2.3.2.3
- Feature:
- http://developer.samsung.com/tizen/feature/mdm
- Usage:
- Admin can provide a TimeZone ID to set the device TimeZone. DateTimeSettings in the device's Settings application lists the possible timeZone values.
- Privilege Level:
- public
- Privilege:
- http://developer.samsung.com/tizen/privilege/mdm.datetime
- Parameters
-
[in] | p_timezoneid | The timezone to use for the device (for example, America/Detroit). DateTimeSettings in the device's Settings application lists the possible values. |
- Returns
- mdm_result_t : MDM_RESULT_SUCCESS on success, an error code on error
- Return values
-
- Permission:
- This API is restricted to registered clients only.
- See also
- mdm_get_time_zone()