How to Write a Date in JSON
JSON has no date type: write a date as a string in ISO 8601 format, in double quotes.
- Programming
- JSON
JSON has no date type: write a date as a string in ISO 8601 format, in double quotes.
Response.json(data, { status }) builds an HTTP response whose body is the data as JSON, with the content type set to application/json.
One call to JsonConvert.SerializeObject turns a C# Dictionary into a JSON object.
Pass an array to PHP’s json_encode and you get back JSON text you can print, store or send.
JSON.stringify turns a JavaScript object into JSON text in one call.
Python’s json.dumps turns a dictionary into a JSON string in one call.
An org.json JSONObject becomes JSON text with a single call to toString.
JArray.FromObject turns a C# string array into a JSON array in one line.
Wrap a C# string array in a JObject property to get a JSON object, with JArray.FromObject doing the conversion.