I am developing a post back function (.NET 4.5) to the add feature REST service, the database is using SQL server 2012, but I cannot add a feature while it has a datetime attributes (type of the datetime column is datetime2(7), this is generated by ArcCatalog).
.Net code:
String.Format("\"attributes\":{{\"fid\":\"0114081403\",\"start_time\": {0}}}", new JavaScriptSerializer().Serialize(record_date));
The Serialize will return the value like this: "\/Date(1355496152000)\/"
I have tried something like FORMATDATETIME, but it still not works. Any help would be appreciated!
Solved! Go to Solution.
Hi Stephen,
I think you should look this article about Supported SQL functions in ArcGIS Server.
ArcGIS Help (10.2, 10.2.1, and 10.2.2)
Richard
Hi Stephen,
I think you should look this article about Supported SQL functions in ArcGIS Server.
ArcGIS Help (10.2, 10.2.1, and 10.2.2)
Richard
Hi Stephen,
Feature service is returning date in UTC() format. http://services.arcgis.com/V6ZHFr6zdgNZuVG0/ArcGIS/rest/services/U2/FeatureServer/0//query?where=1%3...
Try below:
String.Format("\"attributes\":{{\"fid\":\"0114081403\",\"start_time\": {0}}}", record_date.Subtract(new DateTime(1970,1,1,0,0,0)).Milliseconds )