shortFormat

shortFormat(): String;

The shortFormat method of the Date primitive type returns the receiver as a string formatted in the short date format. The following example shows the use of the shortFormat method.

testDateShort();
vars
    date : Date;
begin
    write "The date is " & date.shortFormat;
end;

The output from this example depends on the short format defined for the current locale; for example, it may write The date is 31/8/99.

You can use the defineShortDateFormat method of the DateFormat class if you want to create your own transient format objects and define a short date format that dynamically overrides the format for the locale at run time. (For details, see Chapter 1 of the JADE Encyclopaedia of Classes.)

The shortFormat method returns "*invalid*" for dates before 1601 or after 30827.

If you do not define the EnhancedLocaleSupport parameter in the [JadeEnvironment] section of the JADE initialization file on the database node or you set it to false, inconsistent results could be returned to the application server when running in JADE thin client mode and there are locale overrides, as all overrides on the application server are suppressed if enhanced locale support is not enabled.

Formatting of locale data is done on the application server, based on the locale of the corresponding presentation client. For example, if the locale of your application server is set to English (United Kingdom), which has a default short date format of dd/MM/yyyy, and it has been overridden with a short date format of yyyy-MM-dd, this is returned in the default dd/MM/yyyy format.