using Newtonsoft.Json.Converters;
public class CustomDateTimeConverter : IsoDateTimeConverter
public CustomDateTimeConverter()
base.DateTimeFormat = "yyyy-MM-dd";
[JsonProperty(PropertyName = "Fullname")]
[JsonConverter(typeof(CustomDateTimeConverter))]
[JsonProperty(PropertyName = "ExpiryDate")]
public static void Main()
var product = new Product();
product.Expiry = new DateTime(2008, 12, 28);
product.Sizes = new string[] { "Small" };
string json = JsonConvert.SerializeObject(product, Formatting.Indented);