Thread: Help
View Single Post
Old Jan 24th, 2008, 2:01 PM   #4
Ancient Dragon
PFO God In Training
 
Ancient Dragon's Avatar
 
Join Date: Jun 2005
Location: near St Louis, MO. (USA)
Posts: 544
Rep Power: 4 Ancient Dragon is on a distinguished road
Re: Help

Calculating the number of days between dates can be very tricky, especially if one of the two dates is before the gregorian calendar was invented. If you limit the two dates to be after 1970 then you can use the functions in time.h. create an object of struct tm, fill in the date, them call mktime() to get the number of seconds. Do the same for the second date. Then call datediff() to return the difference.
Ancient Dragon is online now   Reply With Quote