毫秒转换为日期
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;
日期转换毫秒
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;
获取某天的信息
select * from WORKSCANINFO where TO_CHAR(SCANDATE,‘DD-MM-YY‘) in( SELECT TO_CHAR(1511539200000 / (1000 * 60 * 60 * 24) + TO_DATE(‘01-01-70‘, ‘DD-MM-YY‘), ‘DD-MM-YY‘) AS CDATE FROM DUAL)
时间: 2025-01-04 15:36:08