Home >Database >Mysql Tutorial >格林时间转换成正常时间

格林时间转换成正常时间

WBOY
WBOYOriginal
2016-06-07 16:06:432746browse

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;

Statement:
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