Service Stack is probably doing the right thing. Check the .Kind
property of the DateTime
you are serializing. If you don't want a time zone offset included, then it should be DateTimeKind.Unspecified
. My guess is that your value has DateTimeKind.Local
, so it is capturing your local offset.
Consider the following code:
JsConfig.DateHandler = JsonDateHandler.ISO8601;
Debug.WriteLine(JsonSerializer.SerializeToString(DateTime.Now));
Debug.WriteLine(JsonSerializer.SerializeToString(DateTime.UtcNow));
Debug.WriteLine(JsonSerializer.SerializeToString(new DateTime(2013, 1, 1)));
Output on my machine:
"2013-07-27T11:42:02.3711281-07:00"
"2013-07-27T18:42:02.4071518Z"
"2013-01-01T00:00:00.0000000"