📜  将天数转换为月 c# 代码示例

📅  最后修改于: 2022-03-11 14:48:46.985000             🧑  作者: Mango

代码示例1
//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));
}