纽威
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace ICSSoft.FromERP
  6. {
  7. public class ConstWorkPoint
  8. {
  9. public const string WorkPoint = "6000";
  10. public const string Muser = "job";
  11. public const string Musername = "job";
  12. }
  13. public class Common
  14. {
  15. public static decimal TurnDecimal(decimal? deci)
  16. {
  17. decimal result = 0;
  18. if (!string.IsNullOrEmpty(deci.ToString()))
  19. {
  20. result = decimal.Parse(deci.ToString());
  21. }
  22. return result;
  23. }
  24. /// <summary>
  25. /// 将c# DateTime时间格式转换为Unix时间戳格式
  26. /// </summary>
  27. /// <param name="time">时间</param>
  28. /// <returns>long</returns>
  29. public static long ConvertDateTimeToInt(System.DateTime time)
  30. {
  31. System.DateTime startTime = TimeZone.CurrentTimeZone.ToLocalTime(new System.DateTime(1970, 1, 1, 0, 0, 0, 0));
  32. long t = (time.Ticks - startTime.Ticks) / 10000; //除10000调整为13位
  33. return t;
  34. }
  35. }
  36. }