#include <time.h>
time_t maxt = charToTime((*x)[0].date_of_birth);
maxi = 0;
for (int i = 1; i < *number_of_animals; i = i + 1) {
time_t = charToTime((*x)[0].date_of_birth);
if (maxt < t) {
maxt = t;
maxi = i;
}
}
time_t charToTime(char date[]) {
date[2] = date[5] = '\0';
struct tm tmdate = {0};
tmdate.tm_mday= atoi(&date[0]);
tmdate.tm_mon = atoi(&date[3]) - 1;
tmdate.tm_year = atoi(&date[6]);
return mktime( &tmdate );
}