| 12345678910111213141516171819202122232425262728 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Y.Utils.Net20.TimeUtils
- {
- public sealed class DateTimeTool
- {
- public static DateTime TodayDate()
- {
- DateTime today = DateTime.Now;
- DateTime result = new DateTime(today.Year, today.Month, today.Day);
- return result;
- }
- public static DateTime TodayDate(DateTime today)
- {
- DateTime result = new DateTime(today.Year, today.Month, today.Day);
- return result;
- }
- public static TimeSpan TimeSpan(DateTime dt1, DateTime dt2)
- {
- if (dt1 > dt2)
- return dt1 - dt2;
- else
- return dt2 - dt1;
- }
- }
- }
|