I'm working with excel documents using PHP scripts and cannot determine what data type/format PT00H00M00S is, and subsequently I can't find a way to work with it without using regex. I'd like to convert this into a more standard time format (00:00:00) and I can't research this on google because I don't know what "PT...S" is actually called as a date type/format.
Please help me.
It is an ISO 8601 duration.
See this brief overview: http://en.wikipedia.org/wiki/ISO_8601#Durations
Many languages have tools available to work with them, including PHP in the form of DateInterval
.
It's a time interval, where the P
means period. You can use PHP's DateInterval()
to parse the string.
For example (example taken from the PHP documentation):
$interval = new DateInterval('P2Y4DT6H8M');
echo $interval->format('%d days');