From 2a23fbede38fadaf7060510a3cd72a93a8a95ec0 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期五, 18 十二月 2020 17:49:46 +0800
Subject: [PATCH] 2020-12-18-3
---
HDL_ON/Common/Utlis.cs | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/HDL_ON/Common/Utlis.cs b/HDL_ON/Common/Utlis.cs
index 6283094..51066b8 100644
--- a/HDL_ON/Common/Utlis.cs
+++ b/HDL_ON/Common/Utlis.cs
@@ -303,6 +303,24 @@
}
/// <summary>
+ ///
+ /// </summary>
+ /// <param name="isMilliseconds">鏄惁寰</param>
+ /// <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 +331,5 @@
}
+
}
--
Gitblit v1.8.0