public static Int32 GetDateDiffInDays(string sourceDate, string targetDate)
{
TimeSpan spanPassed;
DateTime date1 = System.Convert.ToDateTime(sourceDate);
DateTime date2 = System.Convert.ToDateTime(targetDate);
spanPassed = date1.Subtract(date2);
return spanPassed.Days;
}
{
TimeSpan spanPassed;
DateTime date1 = System.Convert.ToDateTime(sourceDate);
DateTime date2 = System.Convert.ToDateTime(targetDate);
spanPassed = date1.Subtract(date2);
return spanPassed.Days;
}
No comments:
Post a Comment