DateTimeTool.cs 741 B

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