Query date and time (SQLite)

Hello,
I’m trying to run a query to retrieve tag value from an SQlite database, but t_stamp is in integer format and I’m not able to convert to the correct date format (YYYY-MM-DD HH:MM:SS)

I have tried the following Query: SELECT datetime (t_stamp, ‘unixepoch’) FROM sqlt_data_1_2021_04

The value I get back on t_stamp is “NULL”
The integer in the first row is 1617676793399

Any suggestions? What is the format for t_stamp?

try:

SELECT datetime(t_stamp/1000, 'unixepoch');
1 Like

That worked! thx alot!!

1 Like

Hi I try this solution but I still getting NULL Values, did something change?
SELECT datetime(sqlt_data_1_2022_03.t_stamp/1000, 'unixepoch')
FROM sqlt_data_1_2022_03

1 Like