[Bugfix][T106BUG-205] fix the issue of nitz timezone.
Only Configure: No
Affected branch: master
Affected module: systime
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: Icf3395662fa8f7df3cf8a516e4ed7349989a4957
diff --git a/ap/app/zte_comm/at_ctl/src/atconfig/ps_normal.c b/ap/app/zte_comm/at_ctl/src/atconfig/ps_normal.c
index dec4edf..d2479c9 100755
--- a/ap/app/zte_comm/at_ctl/src/atconfig/ps_normal.c
+++ b/ap/app/zte_comm/at_ctl/src/atconfig/ps_normal.c
@@ -22,6 +22,11 @@
//bsim
#include <openssl/aes.h>
+//>>>sj.zhang add @2023-10-08 for fix the issue of timezone.
+#define _XOPEN_SOURCE
+extern long timezone;
+//>>>sj.zhang add @2023-10-08 for fix the issue of timezone end.
+
typedef struct
{
unsigned int pubKeyRsaE[32];
@@ -162,7 +167,10 @@
set_tm.tm_mon = set_tm.tm_mon - 1;
time_tv.tv_sec = mktime(&set_tm);
- time_tv.tv_sec = time_tv.tv_sec + time_zone * 3600 / 4;
+//>>>sj.zhang add @2023-10-08 for fix the issue of timezone.
+ tzset();
+ time_tv.tv_sec = time_tv.tv_sec - timezone;
+//>>>sj.zhang add @2023-10-08 for fix the issue of timezone end.
if (0 != settimeofday(&time_tv, NULL))
diff --git a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/src/atconfig/ps_normal.c b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/src/atconfig/ps_normal.c
index caac23e..83a78d5 100755
--- a/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/src/atconfig/ps_normal.c
+++ b/cap/zx297520v3/zxic_code/zxic_source/zxic_app_open/platform/at_ctl/src/atconfig/ps_normal.c
@@ -22,6 +22,11 @@
//bsim
#include <openssl/aes.h>
+//>>>sj.zhang add @2023-10-08 for fix the issue of timezone.
+#define _XOPEN_SOURCE
+extern long timezone;
+//>>>sj.zhang add @2023-10-08 for fix the issue of timezone end.
+
typedef struct
{
unsigned int pubKeyRsaE[32];
@@ -115,13 +120,13 @@
void *p[5] = {&timeinfo.time_zone,&timeinfo.sav_time,temp1,temp2,timeinfo.univer_time};
int time_zone = 0;
- //>>>sj.zhang add @2023-08-10 for systime NITZ sync enable/disenable.
+//>>>sj.zhang add @2023-08-10 for systime NITZ sync enable/disenable.
if(0 != system("uci get lynq_uci.lynq_sync_time.lynq_modem_sync_time_enable | grep -E \'^1$\'"))
{
at_print(AT_ERR,"zmmi_auto_act: nitz disenabled. \n");
return AT_END;
}
- //>>>sj.zhang add @2023-08-10 end.
+//>>>sj.zhang add @2023-08-10 end.
sc_cfg_get("sntp_time_set_mode", mode, sizeof(mode));
if(strcmp(mode, "manual") == 0)
@@ -158,7 +163,10 @@
set_tm.tm_mon = set_tm.tm_mon - 1;
time_tv.tv_sec = mktime(&set_tm);
- time_tv.tv_sec = time_tv.tv_sec + time_zone * 3600 /4;
+//>>>sj.zhang add @2023-10-08 for fix the issue of timezone.
+ tzset();
+ time_tv.tv_sec = time_tv.tv_sec - timezone;
+//>>>sj.zhang add @2023-10-08 for fix the issue of timezone end.
if (0 != settimeofday(&time_tv,NULL))