CSharp examples for System:DateTime Day
Days Count
using System.Globalization; using System;//from w ww. j a v a2 s . co m public class Main{ public static int DaysCount(DateTime? startDate, DateTime? endDate) { if (startDate.HasValue && endDate.HasValue) { var span = endDate.Value - startDate.Value; var result = span.Days + 1; return result; } return 0; } }