Search code examples
servicestack-text

What is a TimeSpan serialized into in ServiceStack JSON


In JSON from ServiceStack, Timespan values look like P5D for 5 days, etc. What is the name of this format, where is it defined? I need to parse it in Swift.


Solution

  • It uses the XSD Time format. If you're using ServiceStack's new Swift Add Reference Support this should be transparently supported.

    Otherwise you should be able to re-use the ServiceStack.Swift TimeSpan serializer implementation.