DB2 Dates format by region

To give a specific format to the date obtained throught DB2 “current date”, you can use the following method.

Get date with the European format:

select CHAR(current date, EUR) from sysibm.sysdummy1


1 record(s) selected.

Get date with the USA format:

db2 => select char(current date, USA) from sysibm.sysdummy1


1 record(s) selected.

Others formats:

USA Use the IBM standard for U.S. date and time format.
EUR Use the IBM standard for Europe date and time format.
DEF Use a date and time format associated with the territory code.
ISO Use the date and time format of the International Standards Organization.
JIS Use the date and time format of the Japanese Industrial Standard.
LOC Use the date and time format in local form associated with the territory code of the database.

If you like this post write a comment or subscribe you to our feed to obtain future posts in your feed reader.


No comments.

Add a comment