Mega Code Archive

 
Categories / Oracle PLSQL Tutorial / PL SQL Data Types
 

Displaying Date and Time

SQL> SQL> declare   2      v_dt DATE :=sysdate;   3      v_tx VARCHAR2(2000);   4  begin   5      v_tx:=to_char(v_dt,'mm/dd/yyyy');   6      DBMS_OUTPUT.put_line(v_tx);   7      v_tx:=to_char(v_dt,'hh24:mi');   8      DBMS_OUTPUT.put_line(v_tx);   9      v_tx:=to_char(v_dt);  10      DBMS_OUTPUT.put_line(v_tx);  11  end;  12  / 06/09/2007 20:32 09-JUN-07 PL/SQL procedure successfully completed. NLS stands for National Language Support, also known as Globalization Support. NLS allows to you configure the database to conform to the requirements of countries that use different date and time formats. These settings can be viewed in the NLS_SESSION_PARAMETERS and NLS_DATABASE_PARAMETERS dictionary views.