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