Reputation: 5055
I know that to insert a datetime this format yyyy-mm-dd hh:mm:ss
should be used.
However my dataset has a timestamp field that looks like yyyy-mm-dd hh:mm:ss +/-0X:00
, where X
can take many values and is different from my computer's local timezone.
What is the best way to insert a datetime field with such timezone information to SQLite?
Upvotes: 22
Views: 24315
Reputation: 180131
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
Upvotes: 14