Zum Hauptinhalt gehen

esriFieldTypeDate Conversion to String or Date

Kommentare

1 Kommentar

  • Berend Veldkamp

    The value returned by the REST endpoint is in 'ticks', IIRC, the number of milliseconds since 1-1-1970. By default this value is UTC, so you may have to deal with a time offset and/or DST.

    The where clause is something different. This used to be database dependent, so if for instance the backend is Oracle, you would need something like "ACCDATE > to_date('20140709', 'YYYYMMDD')", for other types of database you would need other date formats. Now with AGS 10.2 there's a new standardized query format which for dates supports this: "ACCDATE > date '2014-07-09'". See here for details: http://resources.arcgis.com/en/help/main/10.2/index.html#/Supported_SQL_functions_in_ArcGIS_Server/015400000686000000/

     

    BTW an (arguably) more readable way to write such strings, which reduces the number of quotes and ampersands, is String.Format("ACCDATE > date '{0:yyyy-MM-dd}' AND ACCDATE < date '{1:yyyy-MM-dd}'", FromDate, ToDate)

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.