在 Postgres 中将 UTC 日期转换为 GMT,然后提取小时和分钟

Converting UTC date into GMT in Postgres and then extract the hour and min

我想要实现的是让人们在 8:50 GMT 我的数据库

之后打卡

这是我的查询的一部分,我在其中花费一分钟并将其转换为整数,但我需要做的是在我使用 time_slips.clock_in 之前将其转换为 GMT,然后再使用 [=15] =] 从它。你能在 postgres 中做到这一点吗?

CAST(CONCAT(
    extract(HOUR from time_slips.clock_in), 
    extract(minute from time_slips.clock_in)
) AS integer) > 850

只需将时间戳转换为时间

where (time_slips.clock_in at time zone 'UTC')::time > '08:50';