I really had not idea what formatted strings like
PT5M30S meant when I first encountered them… And I am not alone, almost all developers who joins the team ask the same question: what are these?
Well, did you know that the
ISO8601 standard, commonly used to format dates, also has a duration component?
Even though the Foundation framework in Swift offers the
ISO8601DateFormatter, it obviously doesn’t support durations and since we needed to serialize / deserialize durations for a project, I ended up writing a small library that does just that.