0
点赞
收藏
分享

微信扫一扫

【Linux系统编程】第四十五弹---线程互斥:从问题到解决,深入探索互斥量的原理与实现

夏沐沐 2024-11-12 阅读 7
c#前端
  /// <summary>
  /// 时间戳
  /// </summary>
  /// <returns></returns>
  public static long GetCurrentUinxTime()
  {
      DateTime currentDate = DateTime.Now;//当前时间
      //转化为时间戳
      DateTime localTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
      return long.Parse((currentDate - localTime).TotalSeconds.ToString().Split(',')[0]);
  }
举报

相关推荐

0 条评论