FormatDateTime Function

Action

Converts date and time into the specified format.

Include file

Kernel.bdh

Syntax

FormatDateTime( in  nDate      : number,
                in  nTime      : number,
                in  sFormat    : string,
                out sDate      : string,
                in  bLocalized : boolean optional ): string;

Return value

formatted date string

Parameter Description
nDate Input date with format YYYYMMDD.
nTime Input time of current day in seconds.
sFormat Format control string. See FormatDate function for a description of all format control strings.
sDate Formatted date string.
bLocalized If True, returns the localized date format (optional).

Example

dcltrans
  transaction TFormatDateTime
  var
  sDateTime: string;
begin
  FormatDateTime(19961015, 110, "%Y-%m-%d %H:%M:%S", sDateTime);
  write("datetime = "); write(sDateTime);
  writeln;
end TFormatDateTime;

Output

datetime = 1996-10-15 00:01:50

Sample scripts

MutexLogin.bdf