I have a unique instance where my front-end timestamp is generated based off of a user specific setting. (User can choose their timezeone, 12/24 hour clock).
I have a search feature in which a user can search based off of a timestamp.
The issue that I have is that my timestamp in the database is a UTC timestamp, but the user will want to search based off of the visual timestamp that they see on the page.
For example on the front-end of my application the timestamp shows...
2022-09-21 8:25:26 a.m.
Yet on the postgres side that timestamp will show as...
datetime.datetime(2022, 9, 21, 12, 25, 26, 959035, tzinfo=datetime.timezone.utc)
When a user types in 09-21, as expected, zero results get returned.
I am looking for a way to do convert time timestamp to the users timestamp before the query takes place, but not sure on the best solution, or right direction to to here. Any guidance would be greatly appreciated!