-1

I need my competitors by their age, and to be as precise as possible, i wish to sort them by the time that has passed since their birth untill today.

I would like to know if there is any way to get that time that has passed? something like that:

competitor_birthdate=13.12.1970;
passedtime=todaysdate - competitor_birthdate;

preferable passedtime type would be double.

Thank you

πάντα ῥεῖ
  • 85,314
  • 13
  • 111
  • 183

1 Answers1

1

Try this post: Number of days between two dates C++ Or you can convert date into "Julian day" (JD) -> CURRENT - JD = passed time Passed time should be simple integer (number of days)

I recommend you to use first method ;)

Community
  • 1
  • 1
user1557434
  • 511
  • 5
  • 6
  • Julian Date will not help you with this problem. Julian dates are in the format YDDD or YYDDD. As long as you are in the same year, it is no problem ... but as soon as you cross the year mark, it will not give you accurate results. – Zac Howland Dec 08 '13 at 18:57