3

I need to use Add Features REST service to add a new record to a table in an ArcSDE geodatabase.

One of the field is type of esriFieldTypeDate, but I don't know how to populate this field in JSON script. An example is as follows:

[
    {
      "attributes" : {
        "LOCATION_ID" : 30,
        "LOCATION_NAME" : "SDAF",
        "LOCATION_STATUS" : "IN USE",
        "GEOMETRY_ID" : 30,
        "CREATE_DATE" : "2008/06/16 00:00:00 AM"
      }
    }
]

Column "CREATE_DATE" is of esriFieldTypeDate type. But the above JSON ended up with an error.

2
  • What does the json returned for a Query look like for CREATE_DATE? Commented Apr 12, 2012 at 3:04
  • 1
    Just hit the same wall. Here's what a Date field looks like as returned in JSON from our server: ReviewedDate: 1384300800000 Looks like millis since 1/1/1970 as noted in the answer below Commented Nov 26, 2013 at 18:19

1 Answer 1

3

attributes: The feature attributes. It is a JSON object that contains a dictionary of name-value pairs. The names are the feature field names. The values are the field values and they can be any of the standard JSON types - string, number and boolean. Note that date values are encoded as numbers. The number represents the number of milliseconds since epoch (January 1, 1970) in UTC.

That is what the Esri REST endpoint help says.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.