SQL>
SQL> DECLARE
2 date_in_1 DATE := TO_DATE('24-Feb-2002','DD-MON-YYYY');
3 date_in_2 DATE := TO_DATE('24-Feb-1902','DD-MON-YYYY');
4 date_in_3 DATE := TO_DATE('24-Feb-2002 05:36:00 PM','DD-MON-YYYY HH:MI:SS AM');
5
6 round_1 DATE;
7 round_2 DATE;
8 round_3 DATE;
9
10 BEGIN
11 round_1 := ROUND(date_in_1,'CC');
12 round_2 := ROUND(date_in_2,'CC');
13 round_3 := ROUND(date_in_3,'HH');
14
15 DBMS_OUTPUT.PUT_LINE(TO_CHAR(round_1,'DD-MON-YYYY HH:MI:SS AM'));
16 DBMS_OUTPUT.PUT_LINE(TO_CHAR(round_2,'DD-MON-YYYY HH:MI:SS AM'));
17 DBMS_OUTPUT.PUT_LINE(TO_CHAR(round_3,'DD-MON-YYYY HH:MI:SS AM'));
18 END;
19 /
PL/SQL procedure successfully completed.
SQL>
|