Fetch data based on client's timezone.
Currently, I have a postgres db, where my timestamp data is being saved as a
timestamp with timezone
type, with +0
timezone. I've been fetching my data with the code below
The problem I have, is that the system will group the data based on the DB server's timezone (in this case +0).
How can i update the code so that the data returned will always follow the client's timezone? For example, If the client is in UTC +9, then it should group the date after offsetting the timestamps by 9 hours.2 Replies