Update and rename convert-json-date.md to json-to-date.md

This commit is contained in:
Angelos Chalaris
2017-12-16 14:28:58 +02:00
committed by GitHub
parent c8a3a91642
commit 0ebfd8ab39

12
snippets/json-to-date.md Normal file
View File

@ -0,0 +1,12 @@
### JSON to date
```js
cconst JsonToDate = arr =>
{
const dt = new Date(parseInt(arr.toString().substr(6)));
return dt.getDate() + '/' + dt.getMonth() + '/' + dt.getFullYear();
};
// JsonToDate(/Date(1489525200000)/) -> 15/2/2017
```