Hi, 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? Tom
------------------------------------------------------ This message sent using the FirstClass SMTP/NNTP Gateway. From: Choate Rosemary Hall 333 Christian St. Wallingford, CT. 06492
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.