将postgreSql数据库中毫秒时间戳转成北京时间

按照log_time查询条件,限制分区:

select  to_char(to_timestamp(log_time/1000) AT TIME ZONE 'UTC-8','yyyy-MM-dd HH24:MI:SS') as time
FROM "test"."test" 
WHERE  (log_time>=1574317691000)
  AND (log_time<=1574317868000)
  order by log_time asc ;

猜你喜欢

转载自blog.51cto.com/11315052/2452311