[eluser]ReGeDa[/eluser]
Hello!
I use PostgreSQL as my database storage. I call function
pg_age_to_array (look follow) for parsing the age result.
Code:
function pg_age_to_array($age) {
if (preg_match('/^((\d+) year[s]? )?((\d+) mon[s]? )?((\d+) day[s]? )?(\d{2}):(\d{2}):(\d{2})\.\d+$/',$age,$matches)) {
return array(
'year' => $matches[2],
'mon' => $matches[4],
'day' => $matches[6],
'hour' => $matches[7],
'min' => $matches[8],
'sec' => $matches[9]
);
}
return FALSE;
}
Good luck!