Display format for modified dates in Oracle ____oracle

Source: Internet
Author: User

My present date format is, to be changed into English needs to enter the command:

ALTER session SET Nls_date_language=american;

Changed to:

If you want to change English to Chinese, you can use the command: Alter session set nls_date_language= ' Simplified Chinese '; try it.

The results are as follows:

Note: The command to view the current date is in English and Chinese: Select Sys_context (' USERENV ', ' language ') from dual;

Although these commands can change the date output format, but should be for the current session only, when you open another session, see the date format, or did not change. To change the Oracle default date output format:

(1) Linux system: Change under Oracle User's. Bash_profie in which add like Export nls_date_format= ' yyyy-mm-dd hh24:mi:ss ' or export nsl_date_format= YYYYMMDD;

Make it effective immediately available source. bash_profile

(2) under Windows System:

① Modify the registry, add a string to the registry/HKEY_LOCAL_MACHINE/SOFTWARE/ORACLE/HOME0 primary key, string named Nls_date_format, and the value of the string is the time format you want to define, such as: YYYY-MM-DD Hh24:mi:ss

After the change, re-opened a session

② Modify the Oracle parameter file Initsid.ora. Can be added directly in the parameter file:
Nls_date_format=yyyy-mm-dd-hh24:mi:ss, but the Nls_lang string value of the above position in the registry must be removed.
Initsid.ora generally under the/oracle/oracle/database, remember the SID in Initsid.ora for your Oracle SID, do not find the name Initsid.ora, my is Initorcl.ora.

  Another two articles on modifying date formats: http://blog.csdn.net/gudufeiyang/article/details/5938885  http:// www.itpub.net/thread-28822-1-1.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.