From d16ff6274413f7c85e1bf69f4745e8916cb11438 Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Wed, 26 Jun 2024 18:37:11 +0800 Subject: [PATCH] =?utf8?q?=E5=90=8C=E6=AD=A5=E5=AD=98=E5=82=A8=E6=96=87?= =?utf8?q?=E4=BB=B6=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../nativeui/heart_blood/health_service/health_service.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.cpp b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.cpp index a0ce16690..1dfd7edfa 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.cpp @@ -6,6 +6,7 @@ #include #include #include "kv_store.h" +#include "custom_utils.h" namespace OHOS { @@ -13,12 +14,16 @@ namespace OHOS /*获取日期*/ std::string GetCurrentDate() { + char date[9]; + uapi_get_YYMMDD_Time(date, '\0'); + return std::string(date); +#if 0 time_t now = time(0); tm *ltm = localtime(&now); - char date[9]; // MM/DD/YYYY format strftime(date, sizeof(date), "%m%d%Y", ltm); // Use "%m%d%Y" for MMDDYYYY format return std::string(date); +#endif } // static char *JSON_F_buf=NULL; cJSON *heart_root = NULL; -- 2.17.1