From 62d77d3bb8e7215d9da9ecf6f5aeda0b69f805f8 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期二, 08 十二月 2020 18:57:15 +0800
Subject: [PATCH] 20201208

---
 HDL_ON/Common/Utlis.cs |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/HDL_ON/Common/Utlis.cs b/HDL_ON/Common/Utlis.cs
index 6283094..4597fc4 100644
--- a/HDL_ON/Common/Utlis.cs
+++ b/HDL_ON/Common/Utlis.cs
@@ -2,6 +2,8 @@
 using Shared;
 using System.Text.RegularExpressions;
 using System.Text;
+using System.Collections.Generic;
+using System.Collections;
 
 namespace HDL_ON
 {
@@ -303,6 +305,23 @@
 		}
 
 		/// <summary>
+		/// 鑾峰彇褰撳墠鏃堕棿鎴冲��
+		/// </summary>
+		/// <returns></returns>
+		public static string GetTimestamp(bool isMilliseconds = true)
+		{
+			System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1)); // 褰撳湴鏃跺尯
+			if (isMilliseconds)
+			{
+				return ((long)(DateTime.Now - startTime).TotalMilliseconds).ToString(); // 鐩稿樊绉掓暟
+			}
+			else
+			{
+                return ((long)(DateTime.Now - startTime).TotalSeconds).ToString(); // 鐩稿樊绉掓暟
+            }
+		}
+
+		/// <summary>
 		/// 鑾峰彇璇锋眰鎻愪氦鐨勮瑷�鍙傛暟
 		/// </summary>
 		public static string GetPostLanguageType()
@@ -313,4 +332,5 @@
 		
 	}
 
+
 }

--
Gitblit v1.8.0