Time Zone Confusion in Aggregations

From the docs:

If you display a datetime value in an app, for example by binding a datetime property to the value of a Text component, the stored UTC value will be converted to local time according to the user’s time zone.

This time zone is set automatically from the user’s device and stored in the built-in App variable App Time Zone. As you see from this link, you may override the App Time Zone with a single Update Object.

  • Datetimes as stored as UTC in databases - great!
  • Datetimes as converted to user time zone when displayed - fantastic!

But how are time zones treated in “intermediate operations”, like aggregations? When I aggregate hourly values to daily sums, I would like these “days” to be Europe/Oslo days, not UTC days. Is that how it functions? And what about datetime filters on Data Sources? Are those filters on UTC or local timezone?

Hi,

When filtering on Data Sources, filtering on inbuilt App Variables such as DateValue EQUALS “Date Today” will behave differently based on the user’s time zone. This is because it directly compares to the UTC value stored in the variable.

When aggregating from the database, it behaves the same way regardless of App Time Zone. I have tested with creating objects in Europe/Oslo, and then testing behaviour of aggregation in Europe/Oslo vs America/Denver timezones, and the behaviour is the same.

Rhys

1 Like