Feature Layer Definition Expression TimeStamp query

313
1
12-27-2023 10:01 PM
DeepikaDutta
New Contributor

I am trying to filter features shown on the Map using definition expression. I want to filter between start and end time stamps. The definition expression set on the feature layer is "event_timestamp BETWEEN TIMESTAMP <start_timestamp> AND TIMESTAMP <end_timestamp>".

The problem I am facing is that the filtering does not happen correctly if both start and end timestamps are in local timezone (Asia/Kolkata) or UTC timezone.

But if I convert only start_timestamp to UTC (by subtracting 5 hrs and 30 mins to local time) and keep end timestamp in local timezone, the filtering happens correctly. Why is it so?

Do I need to convert the timestamps to UTC or should I work with local time zone? Why is it that filtering works correctly only if start_timestamp is converted but end_timestamp is not?

0 Kudos
1 Reply
RamaChintapalli
Esri Contributor

Hi,
It is weird that you have to specify the start time in a different timezone than the end time. This might require to see the data/service metadata. Is it possible to share your service or specific details of how data is stored in the feature service? Also, do you have any timezone defined at the service level?

Thanks
Rama

0 Kudos