同步存储文件设计
authorCaisking <3449750381@qq.com>
Wed, 26 Jun 2024 10:37:11 +0000 (18:37 +0800)
committerCaisking <3449750381@qq.com>
Wed, 26 Jun 2024 10:37:11 +0000 (18:37 +0800)
code/sdk/application/wearable/fd230app/nativeui/heart_blood/health_service/health_service.cpp

index a0ce166..1dfd7ed 100644 (file)
@@ -6,6 +6,7 @@
 #include <sys/stat.h>
 #include <ctime>
 #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;