Functions for Finding the Difference in Years Months Day Min Hr and Seconds

Started by tbayne, March 27, 2008, 09:02:13 PM

Previous topic - Next topic

tbayne

Given two dates in the form of Day Month Year Minutes and Seconds is there a function in C to enter two dates and times and retrieve the difference in years months days hours minutes and seconds?

JohnF

Quote from: tbayne on March 27, 2008, 09:02:13 PM
Given two dates in the form of Day Month Year Minutes and Seconds is there a function in C to enter two dates and times and retrieve the difference in years months days hours minutes and seconds?

Would the difftime function suit? It is declared in time.h

John

severach

Looks like mktime() will get the dates converted for you. Wikipedia has more information.

Julian Day