Answer the question
In order to leave comments, you need to log in
How to correctly write the to_char function in postgresql?
there is a reports table with a parameters column of type jsonb and keys offset, time
I make a request, described below, to get the time without taking into account the timezone, but that's not the point ... what's wrong with the request? thanks)
SELECT to_char(time parameters->>'time' - interval parameters->>'offset', 'HH24:MI') FROM reports
Answer the question
In order to leave comments, you need to log in
SELECT to_char(
to_timestamp(parameters->>'time', 'HH24:MI') - (parameters->>'offset' || ' seconds')::interval,
'HH24:MI'
)
FROM reports;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question