Youtube API video duration format
objective-c, youtube-api
Solution
That is an ISO 8601 time format. `PT` indicates that we are dealing with a time peroid. `H`, `M`, `S` and similar ones are obviously the duration in hours, minutes and seconds, etc. I am not sure if Objective-C is able to handle this natively, but you may be able to find something useful knowing how it works.
Problem
``` { "kind": "youtube#videoListResponse", "etag": "\"XlbeM5oNbUofJuiuGi6IkumnZR8/ny1S4th-ku477VARrY_U4tIqcTw\"", "items": [ { "id": "9bZkp7q19f0", "kind": "youtube#video", "etag": "\"XlbeM5oNbUofJuiuGi6IkumnZR8/HN8ILnw-DBXyCcTsc7JG0z51BGg\"", "contentDetails": { "duration": "PT4M13S", "dimension": "2d", "definition": "hd", "caption": "false", "licensedContent": true, "regionRestriction": { "blocked": [ "DE" ] } } } ] } ``` Youtube API v3 provides its video durations in this format `"duration": "PT4M13S"` Is this a standard time format? I'm trying to get a user friendly format using Objective-C. I would like to know if this is a Objective-C DateTime class supported format. If not what are those P,T, charactors stands for?