Using Time Formats
Establishing a Globalization Support Environment
6-14 Oracle Database 2 Day Developer's Guide
ALTER SESSION SET NLS2008LANGUAGE = FRENCH;
3.
Select the current system date.
SELECT TO_CHAR(SYSDATE, 'Day:Dd Month yyyy') FROM DUAL
The output from the example should be similar to the following.
TO_CHAR(SYSDATE,'DAY:DDMONTHYYYY')
----------------------------------
Lundi :05 Mars 2007
4.
Set
NLS2008LANGUAGE
back to its original setting listed in Step 1. For example:
ALTER SESSION SET NLS2008LANGUAGE=AMERICAN;
Using Time Formats
This section shows how to use the
NLS_TIMESTAMP_FORMAT
and
NLS_TIMESTAMP_
TZ_FORMAT
parameters. Some of the time format examples are in the following table.
The
NLS_TIMESTAMP_FORMAT
parameter defines the default date format for the
TIMESTAMP
and
TIMESTAMP WITH LOCAL TIME ZONE
data types. The
NLS_
TERRITORY
parameter determines the default value of
NLS_TIMESTAMP_FORMAT
.
The value of
NLS_TIMESTAMP_FORMAT
can be any valid datetime format model.
The following example shows a value for
NLS_TIMESTAMP_FORMAT
:
NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH:MI:SS.FF'
The
NLS_TIMESTAMP_TZ_FORMAT
parameter defines the default date format for the
TIMESTAMP
and
TIMESTAMP WITH LOCAL TIME ZONE
data types. It is used with
the
TO_CHAR
and
TO_TIMESTAMP_TZ
functions. The
NLS_TERRITORY
parameter
determines the default value of the
NLS_TIMESTAMP_TZ_FORMAT
parameter. The
value of
NLS_TIMESTAMP_TZ_FORMAT
can be any valid datetime format model.
The format value must be surrounded by quotation marks. For example:
See Also:
Oracle Database Reference for more information on the
NLS2008
FORMAT
parameter
Oracle Database Reference for more information on the
NLS2008
LANGUAGE
parameter
Oracle Database SQL Language Reference for information about date
format models
Oracle Database Globalization Support Guide for information about
date/time data types and time zone support
Country
Description
Example
Estonia
hh24:mi:ss
13:50:23
Germany
hh24:mi:ss
13:50:23
China
hh24:mi:ss
13:50:23
UK
hh24:mi:ss
13:50:23
U.S.
hh:mi:ssxff am
1:50:23.555 PM