What is the name of the temporary format PT00H00M00S and what languages ​​do it use?

I work with excel documents using PHP scripts, and I can’t determine what type / format of data PT00H00M00S is, and subsequently I can’t find a way to work with it without using a regular expression. I would like to convert this to a more standard time format (00:00:00), and I cannot research this on google because I do not know what "PT ... S" is actually called a date / format type.

Please help me.

+4
source share
2 answers

This is a duration of ISO 8601 .

See this brief overview: http://en.wikipedia.org/wiki/ISO_8601#Durations

Many languages ​​have tools for working with them, including PHP in the form of DateInterval .

+6
source

This is the time interval where P stands for period. You can use PHP DateInterval() to parse a string.

For example (an example taken from the PHP documentation):

 $interval = new DateInterval('P2Y4DT6H8M'); echo $interval->format('%d days'); 
+1
source

All Articles