处理时间时用到了,记录一下。
计算时间差天数
select extract(day FROM (age('2017-12-10'::date , '2017-12-01'::date)));
计算时间差秒数
select extract(epoch FROM (now() - (now()-interval '1 day') ));