Posted September 02, 2021
Yepoleb: Convert your timestamp to Unix time with something like this:
datetime.datetime.fromisoformat("2017-10-07T19:24:10.409053+00:00").timestamp()
Now use that value to query. Don't touch any SQL native date function, make sure to do everything in Unix time while in database land. Sorry for putting you through this :(.
phaolo: Oh, no problem. datetime.datetime.fromisoformat("2017-10-07T19:24:10.409053+00:00").timestamp()
Now use that value to query. Don't touch any SQL native date function, make sure to do everything in Unix time while in database land. Sorry for putting you through this :(.
Btw, I ended up using this:
SELECT strftime('%Y-%m-%d %H:%M:%S',timestamp,'unixepoch') "Date", product_id, product_title, dl_type, bonus_type, action, serialized_record
FROM changelog
WHERE "dl_type" = 'bonus' AND timestamp >= strftime('%s','2021-01-01 00:00:00');
It seems to work correctly, should I really use that huge date conversion? O_o
Now I wonder if I could extract also the data I need from "serialized_record"..