Datetime fields, datagrids and timezones

I have a table with datetime fields, and a simple datagrid showing columns from the table (default Anvil visualization, just added table’s column keys in the designer).
Then some filters for the datetime fields.
It’s clear to me that datetime objects are timezoned, so when passing between client and server they are accordingly updated.
That’s fine.
But it seems to me that datetime fields in search results are not “timezoned back” when the results are passed back from the server to the client.
If they were, I’d see 8:38 and 8:32 the the results column, making sense with the search filters.


Is there a way to obtain this in an “Anvil” way?
Otherwise, I am thinking about converting input fields to strings on the client, pass the strings to the server and convert them to datetime on the server before issuing the search.

Thanks

Here’s a custom component that will adjust those datetimes for the local timezone, designed for use in datagrids: Local Timezone Display in Data Grids

If you don’t want to use the component itself, you can look at the code to see how it works.

1 Like

Fantastic @jshaffstall !
Now I’m gonna study the code too, but your custom component makes the day.