public class TestDto
{
public DateTime Date { get; set; }
}
string response = Utf8Json.JsonSerializer.ToJsonString(new TestDto { Date = DateTime.Now });
var dto = Utf8Json.JsonSerializer.Deserialize<TestDto>(response);
I want to know how I can add in a resolver to handle this type of DateTime format so that the deserialization does not fail. I don't want to serialize into this format, just not fail to create a DateTime when this format is experienced.
As a side note, this is caused by ServiceStack.Text JsonSerializer which I am swapping to Utf8Json.
I have JSON which looks like this:
I want to know how I can add in a resolver to handle this type of DateTime format so that the deserialization does not fail. I don't want to serialize into this format, just not fail to create a DateTime when this format is experienced.
As a side note, this is caused by ServiceStack.Text JsonSerializer which I am swapping to Utf8Json.