This sample code
DateTime date = new DateTime(2020, 01, 27);
string str = Newtonsoft.Json.JsonConvert.SerializeObject(date, Newtonsoft.Json.Formatting.None,
new Newtonsoft.Json.JsonSerializerSettings() {
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat });
returns str = "\"2020-01-27T00:00:00\"" - so the string's content is surrounded with quotes (here written in escaped form as the debugger does).
But I want only the date and time in ISO format. Why are there quotes? How can I avoid them without removing them afterwards?
I already looked for all serializer options, but didn't found the one helping me...