How to Set timezone in session of SQLite?

2019-09-03 05:18发布

In MySql following query is used to set session

set @@session.time_zone='+05:00';

But it is not working into SQLite.

As on following link, It is not possible to set session in SQLite:

http://stackoverflow.com/questions/2013542/how-to-set-timezone-for-sql

We can select time according to zone as given in following query:

select DateTime('now','-5.30 hours');

but it is not useful to set timezone in session.

So Is there any way to set timezone in session of SQLite when executing any select/insert query?

1条回答
Juvenile、少年°
2楼-- · 2019-09-03 05:29

SQLite times use UTC by default, and can be converted between UTC and the current local time with the localtime and utc modifiers of the date and time functions. However, the difference between UTC and the local time is read from the operating system, and cannot be changed.

查看更多
登录 后发表回答