I have a such query to database:
SELECT * FROM screenings WHERE time(time)>time('now') ORDER BY time(time);
It works fine when the time zone is set to GMT+0:00. But if timezone has a different meaning (for example, GMT+6:00), database query results are in accordance with the GMT+0:00 and, respectively, the displayed information does not match the current time.
So, my question is how to set the local timezone in SQLite?
Thanks.
Don't store values with timezone in the first place. Instead, normalize your data to UTC and use UTC consistently in your queries.
Only when formatting the data for display purposes, adjust for user's local timezone.
Save data in UTC Timezone.
when you need to display then fetch data then convert into user's Timezone
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With