oracle获取当前时间前半小时和整点的时间

create or replace procedure sp_time AS

if to_number(to_char(sysdate,'mi')) -30 > 0 then
v_begintime := trunc(sysdate,'hh24');
v_endtime := trunc(sysdate,'hh24') + 1/48;
else
v_begintime := trunc(sysdate,'hh24') - 1/48;
v_endtime := trunc(sysdate,'hh24');

end if;
dbms_output.put_line('v_begintime:' || to_char(v_begintime,'YYYYMMDD HH24:MI:SS') );
dbms_output.put_line('v_endtime:' || to_char(v_endtime,'YYYYMMDD HH24:MI:SS') );

end;

上一篇:ORA-01788: 此查询块中要求 CONNECT BY 子句


下一篇:JavaFx地位的重要性