datetime('now') gives wrong time datetime('now') gives wrong time sqlite sqlite

datetime('now') gives wrong time


The return value of datetime('now') is in UTC.

Try

datetime('now', 'localtime')


datetime('now') will return in GMT UTC - which you probably should do then handle the conversion to your local timezone in the app. If you keep it in UTC in the database, then convert it in your activities, your app will work correctly as the user moves around timezones