コード例 #1
0
 public static int TotalHoursBetween(DateTime time1, DateTime time2) =>
 DateTimeSpan.CompareDates(time1, time2).Hours;
コード例 #2
0
 public static int TotalDaysBetween(DateTime time1, DateTime time2) =>
 DateTimeSpan.CompareDates(time1, time2).Days;
コード例 #3
0
 public static int TotalMonthsBetween(DateTime time1, DateTime time2) =>
 DateTimeSpan.CompareDates(time1, time2).Months +
 DateTimeSpan.CompareDates(time1, time2).Years * 12;
コード例 #4
0
 public static int TotalWeeksBetween(DateTime time1, DateTime time2) =>
 (int)Math.Ceiling(DateTimeSpan.CompareDates(time1, time2).Days / 7d);
コード例 #5
0
 public static int TotalMillisecondsBetween(DateTime time1, DateTime time2) =>
 DateTimeSpan.CompareDates(time1, time2).Milliseconds;
コード例 #6
0
 public static int TotalMinutesBetween(DateTime time1, DateTime time2) =>
 DateTimeSpan.CompareDates(time1, time2).Minutes;