Search code examples
servicestack-text

ServiceStack date deserialization error


On ServiceStack.Text version 4.0.38

  • ServiceStack.Text.Common.DateTimeSerializer.ParseShortestXsdDateTime("9/10/2015") Works

  • ServiceStack.Text.Common.DateTimeSerializer.ParseShortestXsdDateTime("09/10/2015") Don't work Input string was not in a correct format

  • ServiceStack.Text.Common.DateTimeSerializer.ParseShortestXsdDateTime("10/10/2015") Don't Work same error

It may be related to the length of the date, not sure... anyone have any idea of why is failing on the two latest cases... it worked on previous versions...

Thanks


Solution

  • I strongly recommend sticking with the one true unambiguous way of storing dates in strings, i.e:

    "2015-09-10"