How to insert datetime with timezone to SQLite? How to insert datetime with timezone to SQLite? sql sql

How to insert datetime with timezone to SQLite?


SQLite's built-in date and time functions understand the timezone specification in these strings, but with different timezones, any other operations on these strings (even searches and comparisons) will not work correctly.

If you want to handle time zones, you have to either

  • convert all timestamps to one specific time zone (UTC), so that you can use them for sorting and searching; or
  • leave the time zone information in there, but do all searching, sorting and other computations not in SQL but in your application.