DateTimeTool.cs 843 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Y.Utils.BaseUtils
  7. {
  8. public class DateTimeTool
  9. {
  10. public static DateTime TodayDate()
  11. {
  12. DateTime today = DateTime.Now;
  13. DateTime result = new DateTime(today.Year, today.Month, today.Day);
  14. return result;
  15. }
  16. public static DateTime TodayDate(DateTime today)
  17. {
  18. DateTime result = new DateTime(today.Year, today.Month, today.Day);
  19. return result;
  20. }
  21. public static Tuple<int, int> ToMS(double second)
  22. {
  23. int Minute = 0, Second = 0;
  24. Minute = (int)second / 60;
  25. Second = (int)second % 60;
  26. return new Tuple<int, int>(Minute, Second);
  27. }
  28. }
  29. }