Jdbc sql_last_value for UTC+8


#1

Hi
I want to ask how to set the sql_last_value for different time zone? according my understanding, the sql_last_value is using UTC time. But my database column(last_update_date) is using UTC+8 time. I just want to know how to modify the code in below, so that, the sql_last_value is equal to UTC+8

select * from my_table where last_update_date > :sql_last_value

(Magnus B├Ąck) #2

That's more a question for people who know your dialect of SQL. You can't get Logstash to convert sql_last_value to local time but I'd expect any RDBMS to be able to convert last_update_date to UTC.


#3

I changed my code to

select * from my_table where DATE_SUB(last_update_date, INTERVAL 8 HOUR) > :sql_last_value

and it works


(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.