postgreSQL数据库to_timestamp和to_date的区别
1 SELECT to_timestamp('2020-02-27 12:12:12','yyyy-MM-dd hh24:mi:ss') ; 2 SELECT to_date('2020-02-27 12:12:12','yyyy-MM-dd hh24:mi:ss') ;
to_timestamp返回结果:2020-02-27 12:12:12
to_date返回结果:2020-02-27
1 SELECT to_timestamp('2020-02-27 12:12:12','yyyy-MM-dd hh24:mi:ss') ; 2 SELECT to_date('2020-02-27 12:12:12','yyyy-MM-dd hh24:mi:ss') ;
to_timestamp返回结果:2020-02-27 12:12:12
to_date返回结果:2020-02-27