Home > Database > Mysql Tutorial > body text

格林时间转换成正常时间

WBOY
Release: 2016-06-07 16:06:43
Original
2732 people have browsed it

uscdbmt@rac1:~ date +%s 1414741902 oracle中怎么把这个1414741902转换成正常时间格式 select Numtodsinterval(1414741902-TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone), 1, 3)) * 3600, second)+to_date(1970-1-1, yyyy/mm/dd) from dual; select Numtods

uscdbmt@rac1:~> date +%s
1414741902

oracle中怎么把这个1414741902转换成正常时间格式

select Numtodsinterval(1414741902-TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone), 1, 3)) * 3600, 'second')+to_date('1970-1-1', 'yyyy/mm/dd') from dual;

select Numtodsinterval(1414741902-8*3600, 'second')+to_date('1970-1-1', 'yyyy/mm/dd') from dual;

当前时间转换成格林尼治时间:

select (to_number(to_date('2014/10/31 15:51:42','yyyy/mm/dd hh24:mi:ss') - to_date('19700101','yyyymmdd')) * 86400)-TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone), 1, 3))* 3600 from dual;

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template