Jump to content

ISO 8601 duration time format


3s2ng

Recommended Posts

Hello Freaks,

 

I hope you can help me. I'm trying to parse an ISO 8601 to a simple output like 2days 12hours 5mins 12secs.

 

But the problem is I dont know where to start. Here is the explanation.

 

Duration values are in the ISO 8601 duration format, where P represents "Period", nY represents the number of years, nM the number of months, nD the number of days, T is the date/time separator, nH the number of hours, nM the number of minutes, and nS the number of seconds. So P2DT23H32M51S means "A period of 2 days, 23 hours, 32 minutes, and 51 seconds".

 

PnYnMnDTnH nMnS (e.g., P2DT23H32M51S)

 

I hope anyone can help me with this.

 

Thanks,

MARK

Link to comment
https://forums.phpfreaks.com/topic/56671-iso-8601-duration-time-format/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.