+EXPORT_API int alarmmgr_set_rtc_time(alarm_date_t *time){
+
+ int ret = 0;
+ int error_code = 0;
+
+ if (!time){
+ ALARM_MGR_EXCEPTION_PRINT("Invalid parameter time\n");
+ return ERR_ALARM_INVALID_PARAM;
+ }
+
+ ret = __sub_init();
+ if (ret < 0){
+ return ret;
+ }
+
+ ALARM_MGR_LOG_PRINT("[alarm-lib]:alarmmgr_set_rtc_time() is called\n");
+
+ if (!__alarm_validate_date(time, &error_code)) {
+ ALARM_MGR_EXCEPTION_PRINT("RTC date error\n");
+ return error_code;
+ }
+
+ if (!__alarm_validate_time(time, &error_code)) {
+ ALARM_MGR_EXCEPTION_PRINT("RTC time error\n");
+ return error_code;
+ }
+
+ time->year-=1900;
+ time->month-=1;
+
+ if (!_send_alarm_set_rtc_time
+ (alarm_context, time, &error_code)){
+ return error_code;
+ }
+
+ return ALARMMGR_RESULT_SUCCESS;
+
+}