I have arcgis server 10.2. When i make query to rest map service layer, date field values are coming as number in result. Field type is Date and value is "02/06/16 12:51:25 م". But query result is "1464870816000". But the value return correctly in Identify function. Is there a solution for this problem.
It is returned as a Unix time string. You can convert it directly to a time string:
var d = new Date(1464870816000); console.log( d.toDateString() ); // edit: add formatting console.log( d.format("dd/mm/yyyy hh:MM:ss") );
Yes i know, but i have many layers and many fields. We are using these values in datagridviews or other views. It is difficult to format each date field for display purpose. I am looking a solution to get date values directly as date. Date values comes correctly on 'Identify' function.
As of now, that is expected behavior - query operation always returns raw (unformatted) data while identify returns formatted results. Query results get used in many different ways -- data storing, drawing, sorting -- with formatted results, those usages get limited... in addition, it gives the client app to format data/time according to the client locale etc.