Select to view content in your preferred language

definitionExpression using date field not working as intended

108
2
Thursday
KristieReece
Occasional Contributor

I am creating a fairly simple web app using ArcGIS Maps SDK for Javascript. The web app includes a a map and feature table with a calcite shell to allow users to create a custom definitionExpression. For the most part, everything works as intended; however, I am having an issue with the date filter portion of the query as the filter does not appear to be respecting the dates entered. In my example, the user creates this definitionExpression: "rpt_dttm BETWEEN (TIMESTAMP '2025-04-01 00:00:00') AND (TIMESTAMP '2025-04-02 23:59:59')", but the app is returning a record with a value of "03/31/2025 11:56 PM" and does not return any records after "04/02/2025 4:50 PM".

The time zone was set when the layer was published and in the feature layer declaration within the application. 

If anyone has insight to this issue I would greatly appreciate your assistance.

Thank you,

Kristie

0 Kudos
2 Replies
TanuHoque
Esri Regular Contributor

Hi @KristieReece 

I have a few questions. Hope that'd be okay with you.

  1. I assume while publishing you set the Date Fields time zones. Can you pls check the layer REST resources and see what is the value you see in there for dateFieldTimeReference?
    TanuHoque_0-1744307266686.png
  2. Is this a time aware layer? if so which time zone you set to this layer while making this layer a time aware in ArcGIS Pro.
  3. what time zone are you displaying your values in your js app? local timezone? or in the same time zone you are original data are stored (aka DateFields time zone)?

 

0 Kudos
KristieReece
Occasional Contributor

Hi @TanuHoque ,

I did set the date field time zone to UTC-5, but I do not have the preferred time zone option for display as you have shown in your screen capture. I am still on version 3.0.0 - could this be the issue?

KristieReece_0-1744629538849.png

2. No, the layer is not currently time aware, though it may be in the future.

3. I am looking to display the data in the same time zone the date field is set too which is UTC-5.

Thank you,

Kristie

0 Kudos