Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculating days between two dates in C
#4
What is the reason for this?
Code:
days_until += (month_days - day2 - 5);

Also you're assuming month1 < month2. Your code wouldn't work for inputs like
date1 = 12/31/2011
date2 = 1/1/2012

But yeah SaptaZapta's way is much easier.
Reply


Messages In This Thread
Calculating days between two dates in C - by happylight - 2011-11-30, 12:26 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)