I am saving a value into a Postgres10 interval type field.
When I return the field, I get the following: 3 years 10 mons 1 day 02:18:00
The problem I seem to be having, mostly, is that it would also return 1 day 02:18:00 if the duration is not years and months long.
Is there a clean way to convert this value into a PHP DateInterval object?
I figure I can use regex but that seems a little messy to me.
mons? Is that correct? Do you mean the code should account for non standard words?