SELECT * FROM sys_logininfor WHERE date_trunc('day',access_time) = to_timestamp('2023-06-05 10:10:10','yyyy-mm-dd');
-- 2023-01-01 00:00:00+00 2023-06-01 00:00:00+00 2023-06-07 00:00:00+00
select date_trunc('year', now()), date_trunc('month', now()), date_trunc('day', now());
-- 2023-06-07
select to_date('2023-06-07 10:10:10','yyyy-MM-dd hh24:mi:ss');
-- 2023-06-07 02:13:41
SELECT to_char(now(), 'yyyy-MM-dd hh24:mi:ss');
-- 2023-06-07 10:10:10+00
select to_timestamp(to_char(now(), 'yyyy-MM-dd hh24:mi:ss'),'yyyy-MM-dd hh24:mi:ss');
-- 2023-06-07 00:00:00+00
select to_timestamp(to_char(now(), 'yyyy-MM-dd hh24:mi:ss'),'yyyy-MM-dd');
-- 这里出现时区是因为在安装postgresql的时候没有设置时区
SELECT now();
-- Etc/UTC Asia/Shanghai
show timezone;