Select to view content in your preferred language

Decoding esriFieldTypeDate results

175
2
08-19-2024 02:46 PM
RodmanLow
New Contributor

Querying the same feature layer published (by different people) to both ArcGIS Enterprise 10.9.1 and ArcGIS Online, I am getting a different kind of response in html format to nearly identical queries.  For the Enterprise the result is encoded as an integer (e.g. 1699005600000) using an esriFieldTypeDate field type, but for ArcGIS Online it is decoded to a human readable date format (e.g. 11/3/2023 10:00:00 AM).

Users of our service would prefer the latter.  What would be the best practice?  Is there a parameter in the REST API that can be provided in the query that would set the response format?  Do I need to provide multiple solutions for them (python, javascript and others)?  Should I change how the data is published in Enterprise (perhaps by publishing a database View)?

0 Kudos
2 Replies
JoshuaBixby
MVP Esteemed Contributor

Are they using an Esri tool or software program to query?  I am guessing not since you mention having "to provide multiple solutions for them," so how exactly are these users interacting with the REST API?

0 Kudos
RodmanLow
New Contributor

Good question, Joshua.  You are correct that they haven't specified their tools. 

Although it may not be the most elegant solution, I followed that last approach by creating and publishing a (postgresql) database view using the following SQL:

SELECT *, to_char(in_edit_date, 'MMDDYY') as in_date FROM Dev_Cadastral_Parcels WHERE 1 = 1

0 Kudos