Q

Different date formats in CLP and Command Center

This Content Component encountered an error
A column of type DATE is shown in different formats in the Command Line Processor and Command Center. In CLP it is MM/DD/YYYY (IBM USA standard), and in Command Center it is YYYY-MM-DD (ISO). What is the difference between the two? I get YYYY-MM-DD (ISO) format when I use JDBC. Please explain the difference in the format for Date.

DB2 stores date values using an internal representation. Any values whose data type is DATE, TIME or TIMESTAMP will be represented by character strings upon retrieval. The character string representation is normally the default format of date/time values associated with the country code of the database, unless overridden by specification of the DATETIME option when the program is precompiled or bound to the database. The CLP is a DB2...

application program. My guess is that your default is ISO and the date/time format was changed for the CLP? Perhaps rebinding it would help.

You can always use the CHAR function to change a DATE value to a string representation in any DB2-supported format you wish (ISO, EUR, JIS, USA or LOC). So, using CHAR(DATE_COL, ISO) in the CLP when retrieving dates would cause your CLP dates to be the same as your dates elsewhere (Command Center, JDBC, etc.)

This was first published in October 2002

Dig deeper on IBM DB2 management

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchAWS

SearchContentManagement

SearchOracle

SearchSAP

SearchSOA

SearchSQLServer

Close