TimeHelper.cs 1000 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. namespace ET
  3. {
  4. public static class TimeHelper
  5. {
  6. public const long OneDay = 86400000;
  7. public const long Hour = 3600000;
  8. public const long Minute = 60000;
  9. /// <summary>
  10. /// 客户端时间
  11. /// </summary>
  12. /// <returns></returns>
  13. public static long ClientNow()
  14. {
  15. return TimeInfo.Instance.ClientNow();
  16. }
  17. public static long ClientNowSeconds()
  18. {
  19. return ClientNow() / 1000;
  20. }
  21. public static DateTime DateTimeNow()
  22. {
  23. return DateTime.Now;
  24. }
  25. public static long ServerNow()
  26. {
  27. return TimeInfo.Instance.ServerNow();
  28. }
  29. public static long ClientFrameTime()
  30. {
  31. return TimeInfo.Instance.ClientFrameTime();
  32. }
  33. public static long ServerFrameTime()
  34. {
  35. return TimeInfo.Instance.ServerFrameTime();
  36. }
  37. }
  38. }