SQL>
SQL> DECLARE
2 date_in DATE := TO_DATE('24-Feb-2002 05:16:00 PM'
3 ,'DD-MON-YYYY HH:MI:SS AM');
4 date_rounded DATE;
5 date_truncated DATE;
6 BEGIN
7 date_rounded := ROUND(date_in);
8 date_truncated := TRUNC(date_in);
9
10 DBMS_OUTPUT.PUT_LINE(TO_CHAR(date_rounded, 'DD-MON-YYYY HH:MI:SS AM'));
11 DBMS_OUTPUT.PUT_LINE(TO_CHAR(date_truncated,'DD-MON-YYYY HH:MI:SS AM'));
12 END;
13 /
PL/SQL procedure successfully completed.
SQL>
|