Implementation of DB2 date format change

Source: Internet
Author: User
Tags db2 connect db2 connect to db2 date

DB2 date format change is a problem that many people have mentioned. The following describes how to solve the problem of DB2 date format change. If you have encountered a similar problem u, take a look.

The default DB2 date format is determined by the database country CODE (territory code) of the database (the database country/region CODE is determined when the database is created ). For example, the time format output is as follows:

Values current date
1
----------
05/30/2003

1 record (s) selected.

That is, the time format is DD/MM/YYYY. If you want to modify the format, you need to recompile the DB2 toolkit with different time formats. Supported formats include:

DEF uses the date and time format related to the database country/region code.
EUR uses the IBM European standard date and time format.
ISO uses the ISO date and time format.
JIS uses the Japanese Industrial Standard date and time format.
LOC uses the local date and time format combined with the database country/region code.
USA uses the standard IBM date and time format.

Use the following steps to modify the time date format to ISO format (YYYY-MM-DD ):

1. Change to the sqllib \ bnd directory under the command line.
For example:
On Windows: c: \ program files \ IBM \ sqllib \ bnd
On UNIX platforms:/home/db2inst1/sqllib/bnd

2. Connect to the database as a member of SYSADM:
Db2 connect to database name
Db2 bind @ db2ubind. lst datetime ISO blocking all grant public

(In your actual application, modify the Database Name and expected time format)

After the above work is completed, you can see that the date format is changed:

Values current date
1
----------
2003-

1 record (s) selected.
 

Basic knowledge of DB2 Date and Time

Tips for DB2 data deletion

DB2 event monitoring command

Learn about DB2 snapshot monitoring

How to Implement online DB2 Import

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.