From 885432299752250856b0c0637571247323570e7e Mon Sep 17 00:00:00 2001 From: Diego <2248356998@qq.com> Date: Wed, 21 Aug 2024 16:08:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(opcuamaster):=20=E6=9C=8D=E5=8A=A1=E7=AB=AF?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=88=B3=E9=80=89=E9=A1=B9=E5=9C=A8=E8=BD=AE?= =?UTF-8?q?=E8=AF=A2=E6=A8=A1=E5=BC=8F=E4=B8=8B=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ThingsGateway.Plugin.OpcUa/OpcUaMaster/OpcUaMaster.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugin/ThingsGateway.Plugin.OpcUa/OpcUaMaster/OpcUaMaster.cs b/src/plugin/ThingsGateway.Plugin.OpcUa/OpcUaMaster/OpcUaMaster.cs index fa4f48154..5fd57b8b8 100644 --- a/src/plugin/ThingsGateway.Plugin.OpcUa/OpcUaMaster/OpcUaMaster.cs +++ b/src/plugin/ThingsGateway.Plugin.OpcUa/OpcUaMaster/OpcUaMaster.cs @@ -215,9 +215,13 @@ public class OpcUaMaster : CollectBase { value = data.Item3; } - var isGood = StatusCode.IsGood(data.Item2.StatusCode); - var time = data.Item2.SourceTimestamp; + var isGood = StatusCode.IsGood(data.Item2.StatusCode); + DateTime time = default; + if (_driverProperties.SourceTimestampEnable) + { + time = data.Item2.SourceTimestamp.ToLocalTime(); + } if (isGood) { item.SetValue(value, time);