using Newtonsoft.Json;
var settings = new JsonSerializerSettings() { DateFormatString = "yyyy-MM-dd" };
var nikolaTesla = new Person() { BirthDate = new DateTime(year: 1856, month: 7, day: 10) };
var json = JsonConvert.SerializeObject(nikolaTesla, Formatting.Indented, settings);
Console.WriteLine(json);
Code language: C# (cs)