From 2fc1b7cbf8ae63ebc4b92fde4203317b7f3e0f33 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期四, 21 五月 2020 11:33:49 +0800 Subject: [PATCH] 2020-5-21-1 --- ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs | 28 ++++++++++++++++++---------- 1 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs index 7b071fd..44cfcd6 100644 --- a/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs +++ b/ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs @@ -38,7 +38,7 @@ /// <summary> /// 鏃堕棿鎴� /// </summary> - public int timeLong = 0; + public long timeLong = 0; public async void Show() { @@ -81,7 +81,7 @@ //杩涙潵鏇存柊涓�娆″�� logicId = logic.LogicId; timeValue = int.Parse(logic.Conditions[0]["DoorLockOpenDelayTime"]) / 3600; - timeLong = int.Parse(logic.Conditions[0]["TriggerTime"]); + timeLong = long.Parse(logic.Conditions[0]["TriggerTime"]); } catch { } @@ -549,6 +549,7 @@ { if (!SkipView.ExistLogic(logic, Send.CurrentDoorLock)) { + ///涓嶆槸璇ラ棬閿佽嚜鍔ㄥ寲灏变笉鏄剧ず鍑烘潵; continue; } #region 鑷姩鍖栧竷灞�View @@ -708,15 +709,22 @@ }; } } - - - public DateTime GetLocalTime(int unixTimeStamp) + /// <summary> + /// 鏃堕棿鎴宠浆鎹㈡垚鏃堕棿鏍煎紡 + /// </summary> + /// <param name="unixTimeStamp">鏃堕棿鎴�</param> + /// <returns></returns> + public DateTime GetLocalTime(long unixTimeStamp) { - DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); - long lTime = long.Parse(unixTimeStamp + "0000000"); - TimeSpan toNow = new TimeSpan(lTime); - DateTime dtResult = dtStart.Add(toNow); - return dtResult; + //DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); + //long lTime = long.Parse(unixTimeStamp + "0000000"); + //TimeSpan toNow = new TimeSpan(lTime); + //DateTime dtResult = dtStart.Add(toNow); + //return dtResult; + + System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 褰撳湴鏃跺尯 + return startTime.AddMilliseconds(unixTimeStamp); + } } } -- Gitblit v1.8.0