GPC question_(re)

Fri, 24 Oct 1997 20:30:17 +0100 (MET)


Tom:

>	I am looking for a function which returns the current time or date,
is there
>one built in, if so, what do I put after the USES?

There is a built-in function, GetTimeStamp, which returns the current date
and time (in a record variable of type TimeStamp).  You don't need to include
a special unit, like in Borland Pascal.

The procedure is described in the documentation.  Alternatively, try the
program below which demonstrates the use of GetTimeStamp.

Another possibility (instead of GetTimeStamp) is the BPcompat package at the
GPC homepage which provides most of the Borland procedures that are not in
GPC (yet).

Regards,

  Jesper Lund


program TimeDemo;

var
  dt : TimeStamp;

begin
  GetTimeStamp (dt);

  with dt do
  begin
    Writeln ('Date: ', month, '/', day, '/', year, '  ',
                       'Time: ',  hour, ':', minute);
  end;
end.


Jesper Lund (jel@hha.dk)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es