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