| | |
| | | using Shared; |
| | | using System.Text.RegularExpressions; |
| | | using System.Text; |
| | | using System.Collections.Generic; |
| | | using System.Collections; |
| | | |
| | | namespace HDL_ON |
| | | { |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取当前时间戳值 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | /// |
| | | /// </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(); // 相差秒数 |
| | | return ((long)(DateTime.Now - startTime).TotalMilliseconds).ToString(); // 相差微秒数 |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | } |