Home > Database > Mysql Tutorial > ORACLE毫秒与日期的相互转换

ORACLE毫秒与日期的相互转换

WBOY
Release: 2016-06-07 14:55:19
Original
1224 people have browsed it

SELECT TO_CHAR(1406538765000 / (1000 * 60 * 60 * 24) + TO_DATE('1970-01-01 08:00:00', 'YYYY-MM-DD HH:MI:SS'), 'YYYY-MM-DD HH24:MI:SS') AS CDATE FROM DUAL; 日期转换毫秒 1 2 3 SELECT TO_NUMBER(TO_DATE('2014-07-28 17:12:45', 'YYYY-MM-DD HH2

SELECT TO_CHAR(1406538765000 / (1000 * 60 * 60 * 24) +     

        TO_DATE('1970-01-01 08:00:00', 'YYYY-MM-DD HH:MI:SS'), 'YYYY-MM-DD HH24:MI:SS') AS CDATE     

 FROM DUAL;

日期转换毫秒

1

2

3

SELECT TO_NUMBER(TO_DATE('2014-07-28 17:12:45', 'YYYY-MM-DD HH24:MI:SS') -     

                TO_DATE('1970-01-01 8:0:0', 'YYYY-MM-DD HH24:MI:SS')) * 24 * 60 * 60 * 1000     

 FROM DUAL;

获取系统当前时间

1

select to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') 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