TimeStampTool.cs 473 B

1234567891011121314151617181920
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace Azylee.Core.DataUtils.DateTimeUtils
  6. {
  7. public class TimeStampTool
  8. {
  9. /// <summary>
  10. /// 获取时间戳
  11. /// </summary>
  12. /// <returns></returns>
  13. public static long Get()
  14. {
  15. TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
  16. return (long)ts.TotalSeconds;
  17. }
  18. }
  19. }