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;
标签:sysdate,半小时,整点,char,begintime,hh24,oracle,endtime,trunc 来源: https://www.cnblogs.com/lipeng20004/p/15863109.html