>./ Alex Tech Blog / Convert esriFieldTypeDate, ESRI date, or epoch to a date format using javascript

Convert esriFieldTypeDate, ESRI date, or epoch to a date format using javascript

1
2
3
4
5
6
7
8
// eftd is an esriFieldTypeDate
eftd = 1379894400000;
dt = new Date(eftd).toUTCString(); // "Mon, 23 Sep 2013 00:00:00 GMT"
dt = new Date(eftd).toISOString() // "2013-09-23T00:00:00.000Z"
dt = new Date(eftd).toISOString().substr(0,10); // "2013-09-23"

dt = new Date(eftd);
dtStr = dt.getFullYear()+ '-' +(dt.getMonth() + 1)+ '-' +(dt.getDate() + 1); // "2013-9-23"
#aws #cheat sheet #codecommit #esri #github #honeycode #javascript #jupyter #linux #machine learning #pandas #php #python #salesforce #ssh