summaryrefslogtreecommitdiff
path: root/fxjs
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs')
-rw-r--r--fxjs/cfxjse_formcalc_context.cpp4
-rw-r--r--fxjs/js_define.cpp5
2 files changed, 5 insertions, 4 deletions
diff --git a/fxjs/cfxjse_formcalc_context.cpp b/fxjs/cfxjse_formcalc_context.cpp
index d164c626b9..a2773b27d0 100644
--- a/fxjs/cfxjse_formcalc_context.cpp
+++ b/fxjs/cfxjse_formcalc_context.cpp
@@ -954,7 +954,7 @@ int32_t DateString2Num(const ByteStringView& szDateString) {
void GetLocalTimeZone(int32_t* pHour, int32_t* pMin, int32_t* pSec) {
time_t now;
- time(&now);
+ FXSYS_time(&now);
struct tm* pGmt = gmtime(&now);
struct tm* pLocal = localtime(&now);
@@ -2539,7 +2539,7 @@ void CFXJSE_FormCalcContext::Time(CFXJSE_Value* pThis,
}
time_t now;
- time(&now);
+ FXSYS_time(&now);
struct tm* pGmt = gmtime(&now);
args.GetReturnValue()->SetInteger(
diff --git a/fxjs/js_define.cpp b/fxjs/js_define.cpp
index 124fd91651..0a18b6d15b 100644
--- a/fxjs/js_define.cpp
+++ b/fxjs/js_define.cpp
@@ -13,6 +13,7 @@
#include <limits>
#include <vector>
+#include "core/fxcrt/fx_extension.h"
#include "fxjs/cjs_document.h"
#include "fxjs/cjs_object.h"
@@ -22,7 +23,7 @@ double GetLocalTZA() {
if (!FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS))
return 0;
time_t t = 0;
- time(&t);
+ FXSYS_time(&t);
localtime(&t);
#if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_
// In gcc 'timezone' is a global variable declared in time.h. In VC++, that
@@ -174,7 +175,7 @@ void JSDestructor(v8::Local<v8::Object> obj) {
double JS_GetDateTime() {
if (!FSDK_IsSandBoxPolicyEnabled(FPDF_POLICY_MACHINETIME_ACCESS))
return 0;
- time_t t = time(nullptr);
+ time_t t = FXSYS_time(nullptr);
struct tm* pTm = localtime(&t);
int year = pTm->tm_year + 1900;