wei
2020-12-11 4f40e8385ff6725be8e8b642e50f9f7201a27dfa
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,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 +333,5 @@
      
   }
}