Menu
Hi Guys,
I was wondering what the best approach is to converting into a readable format a date/time duration that looks like this:
P1DT13H22M15S
It’s in [URL=”http://en.wikipedia.org/wiki/ISO_8601″]iso_8601
Any number between T and H is the number of hours
Any number between H and M is minutes
Any number between M and S is seconds
Any number between P and D is number of days
and
P followed by T means the duration doesn’t include a day (is less than a day).
Is there anything in PHP that will do this conversion automatically? Otherwise, is preg_match the best option?
Can anyone suggest a regex? ?
Thanks!