json parse with date

Solutions on MaxInterview for json parse with date by the best coders in the world

showing results for - "json parse with date"
Holly
25 Apr 2019
1
2const text =
3  '{"name":"John", "birth":"1986-12-14", "city":"New York"}';
4
5  const obj = JSON.parse(text);
6obj.birth = new Date(obj.birth);
7
8  
9document.getElementById("demo").innerHTML = obj.name + ", " + obj.birth; 
similar questions
queries leading to this page
json parse with date