From 37fb57a3f5040b55c179e9c8d82c1c4168cda886 Mon Sep 17 00:00:00 2001 From: PandaX <18610165312@163.com> Date: Fri, 3 Jan 2025 02:42:50 +0000 Subject: [PATCH] =?UTF-8?q?[fix]=20=E6=97=A5=E6=9C=9F=E6=97=B6=E9=97=B4-8?= =?UTF-8?q?=E5=B0=8F=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: PandaX <18610165312@163.com> --- iothub/netbase/hook_base.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iothub/netbase/hook_base.go b/iothub/netbase/hook_base.go index 9d2cca4..f7b52e6 100644 --- a/iothub/netbase/hook_base.go +++ b/iothub/netbase/hook_base.go @@ -143,7 +143,7 @@ func UpdateDeviceTelemetryData(data string) map[string]interface{} { return resTel } } - tel["ts"] = time.Now().Format("2006-01-02 15:04:05.000") + tel["ts"] = time.Now().Local().Format("2006-01-02 15:04:05.000") return tel } @@ -155,7 +155,7 @@ func UpdateDeviceAttributesData(data string) map[string]interface{} { global.Log.Error("上传属性数据结构错误") return nil } - tel["ts"] = time.Now().Format("2006-01-02 15:04:05.000") + tel["ts"] = time.Now().Local().Format("2006-01-02 15:04:05.000") return tel } @@ -203,7 +203,7 @@ func GetEventFromTopic(reg, topic string) (identifier string) { // eventType 事件类型 info alarm func CreateEventInfo(msgType, eventType, content string, deviceAuth *model.DeviceAuth) *DeviceEventInfo { - ts := time.Now().Format("2006-01-02 15:04:05.000") + ts := time.Now().Local().Format("2006-01-02 15:04:05.000") ci := &tdengine.Events{ DeviceId: deviceAuth.DeviceId, Name: msgType,