TimeHelper.cs 1.0 KB

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