Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

json date format

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)
Source by makolyte.com #
 
PREVIOUS NEXT
Tagged: #json #date #format
ADD COMMENT
Topic
Name
4+1 =