Oracle数据库中 to_date()函数的用法

--日期到字符串
select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') as uptime from dual

--字符到日期
select to_date('2018-08-28 08:08:08', 'yyyy-mm-dd hh24:mi:ss') as uptime from dual

--当前时间毫秒
select ((sysdate - to_date('1970-01-01 08:00:00', 'yyyy-mm-dd hh24:mi:ss')) *1000 * 60 * 60 * 24) as uptime from dual

posted on 2018-09-27 09:46  程序员的成长之道  阅读(771)  评论(0)    收藏  举报

导航