The main goal of my query is to convert a UNIX timestamp to a UTC timestamp and then to the local timezone but it's not working. Here is my query:
WITH final AS (
SELECT
cv.validated_at,
g.locale,
from_unixtime(cv.validated_at) AS event_time_UTC,
at_timezone(from_unixtime(cv.validated_at), g.locale) AS event_time_local_formatted
FROM
checkin_validated cv
LEFT JOIN
gyms g ON g.id = cv.gym_id
)
SELECT * FROM final
LIMIT 100
But you can see in my results that event_time_UTC and event_time_local_formatted are the same timestamp and I am losing my mind trying to understand why
Any ideas?