*
* This function determines the default timezone by querying the system once and storing the
* obtained timezone as default until the application terminates.
+ *
+ * To query the system for the current timezone, use i18n_timezone_detect_host_timezone().
+ *
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @param[out] timezone A default i18n_timezone_h. Clients are responsible for deleting the time zone object returned.
*/
int i18n_timezone_get_dst_savings(i18n_timezone_h timezone, int32_t *dst_savings);
+/**
+ * @brief Creates an #i18n_timezone_h detected from the current host system configuration.
+ * @details This function does not change the default time zone and does not update the current
+ * ICU's default. It may return a different #i18n_timezone_h from the one returned by
+ * i18n_timezone_create_default().
+ * @since_tizen 3.0
+ *
+ * @param[out] timezone A new instance of #i18n_timezone_h detected from the current host system
+ * configuration. Users are responsible for deleting the returned time zone object with
+ * i18n_timezone_destroy().
+ *
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ */
+int i18n_timezone_detect_host_timezone(i18n_timezone_h *timezone);
+
#ifdef __cplusplus
}
#endif
*
* This function determines the default timezone by querying the system once and storing the
* obtained timezone as default until the application terminates.
+ *
+ * To query the system for the current timezone, use i18n_timezone_detect_host_timezone().
+ *
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @param[out] timezone A default i18n_timezone_h. Clients are responsible for deleting the time zone object returned.
*/
int i18n_timezone_get_dst_savings(i18n_timezone_h timezone, int32_t *dst_savings);
+/**
+ * @brief Creates an #i18n_timezone_h detected from the current host system configuration.
+ * @details This function does not change the default time zone and does not update the current
+ * ICU's default. It may return a different #i18n_timezone_h from the one returned by
+ * i18n_timezone_create_default().
+ * @since_tizen 3.0
+ *
+ * @param[out] timezone A new instance of #i18n_timezone_h detected from the current host system
+ * configuration. Users are responsible for deleting the returned time zone object with
+ * i18n_timezone_destroy().
+ *
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ */
+int i18n_timezone_detect_host_timezone(i18n_timezone_h *timezone);
+
#ifdef __cplusplus
}
#endif
* <td>getDSTSavings</td>
* </tr>
* <tr>
+ * <td>@ref CAPI_BASE_UTILS_I18N_TIMEZONE_MODULE</td>
+ * <td>#i18n_timezone_detect_host_timezone</td>
+ * <td>detectHostTimeZone</td>
+ * </tr>
+ * <tr>
* <td>@ref CAPI_BASE_UTILS_I18N_UENUMERATION_MODULE</td>
* <td>#i18n_uenumeration_destroy</td>
* <td>uenum_close</td>
*
* This function determines the default timezone by querying the system once and storing the
* obtained timezone as default until the application terminates.
+ *
+ * To query the system for the current timezone, use i18n_timezone_detect_host_timezone().
+ *
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @param[out] timezone A default i18n_timezone_h. Clients are responsible for deleting the time zone object returned.
*/
int i18n_timezone_get_dst_savings(i18n_timezone_h timezone, int32_t *dst_savings);
+/**
+ * @brief Creates an #i18n_timezone_h detected from the current host system configuration.
+ * @details This function does not change the default time zone and does not update the current
+ * ICU's default. It may return a different #i18n_timezone_h from the one returned by
+ * i18n_timezone_create_default().
+ * @since_tizen 3.0
+ *
+ * @param[out] timezone A new instance of #i18n_timezone_h detected from the current host system
+ * configuration. Users are responsible for deleting the returned time zone object with
+ * i18n_timezone_destroy().
+ *
+ * @retval #I18N_ERROR_NONE Successful
+ * @retval #I18N_ERROR_INVALID_PARAMETER Invalid function parameter
+ */
+int i18n_timezone_detect_host_timezone(i18n_timezone_h *timezone);
+
#ifdef __cplusplus
}
#endif
* reflect the change, i.e. the returned time zone will be the same as for the first function
* call.
*
+ * To query the system for the current timezone, use i18n_timezone_detect_host_timezone()
+ * from the Timezone module.
+ *
* The default time zone may be changed with i18n_ucalendar_set_default_timezone()
* or with the i18n Timezone API.
+ *
* @remarks The specific error code can be obtained using the get_last_result()
* method. Error codes are described in #i18n_error_code_e description.
* @since_tizen 2.3.1
*
* @param[out] result A buffer to receive the result, or @c NULL
- * @param[in] result_capacity The capacity of the @c result buffer
+ * @param[in] result_capacity The capacity of the @c result buffer
*
* @return The @c result string length, not including the terminating @c NULL.
* @exception #I18N_ERROR_NONE Successful
return I18N_ERROR_NONE;
}
+
+int i18n_timezone_detect_host_timezone(i18n_timezone_h *timezone)
+{
+ retv_if(timezone == NULL, I18N_ERROR_INVALID_PARAMETER);
+
+ *timezone = TimeZone::detectHostTimeZone();
+
+ return I18N_ERROR_NONE;
+}