Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculating days between two dates in C
#2
C has a function, mktime(), for converting from a struct with year/month/day/hour/minute/second fields to a single long int (seconds since the epoch).
Use that to convert both dates, subtract the ints, divide by seconds in a day.
Reply


Messages In This Thread
Calculating days between two dates in C - by SaptaZapta - 2011-11-30, 06:59 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)