Converts a date into the specified format.
Kernel.bdh
FormatDate( in nDate :number, in sFormat : string, in bLocalized : boolean optional) : string;
formatted date string
| Parameter | Description |
|---|---|
| nDate | Integer input date with format YYYYMMDD, for example, 19980501 (May 1, 1998) |
| sFormat |
Format control string. Possible format characters for date formatting:
Default format strings:
|
| bLocalized | If True, returns the localized date format (optional). |
dcltrans
transaction TFormatDate
var
nDate : number;
sDate : string;
sWeekday : string;
begin
nDate := GetCurrentDate();
sDate := FormatDate(nDate, "%m/%d/%Y");
sWeekday := FormatDate(nDate, "%A");
print("Current Date: " + sDate);
print("Today is " + sWeekday);
end TFormatDate;
Current Date: 08/27/2012 Today is Monday