Skip to content

Instantly share code, notes, and snippets.

@shahriarhossain
Created January 29, 2016 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shahriarhossain/aace34a8aa374784f2b6 to your computer and use it in GitHub Desktop.
Save shahriarhossain/aace34a8aa374784f2b6 to your computer and use it in GitHub Desktop.
var settings = new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore,
Converters = new List<JsonConverter>
{
new IsoDateTimeConverter()
{
DateTimeFormat= "yyyy-MM-dd HH:mm:ss"
}
}
};
var myContentJson = JsonConvert.SerializeObject(someObject, settings);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment