欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

oracle中将格林威治时间转化为一般时间

程序员文章站 2024-04-04 21:59:41
...

如题 Oracle to_char(trunc(b.starttime/1000/60/60/24)+TO_DATE('1970-01-01 00:00:00', 'yyyy-MM-dd hh24:mi:ss'),'yyyy-mm-dd')||' '||lpad(mod(trunc(b.starttime/1000/60/60),24),2,'0')||':'||lpad(mod(trunc(b.starttime/1000/60),60),2,'0')||':'||lp

如题 Oracle
to_char(
trunc(b.starttime/1000/60/60/24)+TO_DATE('1970-01-01 00:00:00', 'yyyy-MM-dd hh24:mi:ss'),
'yyyy-mm-dd')
||' '
||lpad(mod(trunc(b.starttime/1000/60/60),24),2,'0')
||':'
||lpad(mod(trunc(b.starttime/1000/60),60),2,'0')
||':'
||lpad(mod(trunc(b.starttime/1000),60),2,'0') as cdate