Answers for "count total days in month in c#"

C#
0

get number of days between two dates c#

(EndDate - StartDate).TotalDays
Posted by: Guest on October-08-2021
0

convert number of days into months c#

//This function is meant for general conversions only.  
//Converting the months between two known date ranges may cause odd results
private int ConvertDaysToMonths(double days)
{
  // Divide by this constant to convert days to months.
  const double daysToMonths = 30.4368499;

  return Convert.ToInt32(Math.Floor(days / daysToMonths));
}
Posted by: Guest on June-21-2020

C# Answers by Framework

Browse Popular Code Answers by Language