Skip to main content
Previous section

TODATEDefaultFormat

Set the default date format for the SQL TO_DATE() function.

Synopsis

[SQL]    TODATEDefaultFormat=n

n is any string in a format appropriate for the TO_DATE() function. The default string is DD MON YYYY.

Description

The value n provides the format string that the SQL TO_DATE() function uses when TO_DATE() is called without a format specified.

Examples

The following is an example:

TODATEDefaultFormat=DD MON YYYY
Copy code to clipboard

And the following another example:

TODATEDefaultFormat=YYYY DD MM
Copy code to clipboard

For more examples and an in-depth discussion about valid date strings, see the Format section of the “TO_DATE” reference page in InterSystems RSQL Reference.

Changing This Parameter

On the SQL page of the Management Portal (System Administration > Configuration > SQL and Object Settings > SQL), in the TO_DATE default format field, enter a valid format string.

To set the desired value for TODATEDefaultFormat from the Terminal, use the SetToDateDefaultFormat() method of the %SYSTEM.SQL class. See the class reference for details.

You can also change TODATEDefaultFormat with the Config.SQL class (as described in the class reference) or by editing the CPF in a text editor (as described in the Editing the Active CPF section of the “Introduction to the Configuration Parameter File” chapter in this book).