Note
This variable was introduced in OceanBase Database V2.2.30.
Description
nls_timestamp_format specifies the format to use when you convert a timestamp or LTZ timestamp to a string, or when you implicitly convert a string to a timestamp or LTZ timestamp.
Applicability
This variable is applicable to only OceanBase Database in Oracle mode.
Attributes
| Attribute | Description |
|---|---|
| Type | Varchar |
| Default value | DD-MON-RR HH.MI.SSXFF AM |
| Value range | N/A |
| Effective scope | |
| Modifiable | Yes. You can use the SET statement to modify the variable. |
| Plan generation affected | Yes |
Considerations
This variable specifies the default date format used for the to_CHAR and to_TIMESTAMP functions. The commonly used format is YYYY-MM-DD HH24:MI:SS.FF.
Examples
Set the variable at the session level
obclient> SET nls_timestamp_format='YYYY-MM-DD HH24:MI:SS.FF';Set the variable at the global level
obclient> SET GLOBAL nls_timestamp_format='YYYY-MM-DD HH24:MI:SS.FF';