Postgresql 时间串转换格式

1. 时间:02-AUG-18 17:01:34 转成正常 年月日 时分秒

select to_char(to_timestamp('02-AUG-18 17:01:34', 'dd-mon-yy,hh24:mi:ss') ,'YYYY-MM-DD hh24:mi:ss') from   dual;

 

 

2.unix时间串: 1533621393 转换成字符串

select to_char(to_timestamp(1533621393),'yyyy-MM-dd hh24:mi:ss') from dual;

 

posted @ 2018-09-10 15:32  王默默  阅读(10594)  评论(0编辑  收藏  举报