DelphiBasics
Time
Function
Gives the current time SysUtils unit
 function Time():TDateTime;
Description
The Time function returns the current time in the local time zone.
 
Because the return value is a TDateTime type, the date component is set to zero (30/12/1899).
Notes
Warning : the date value is one day short of the last day of the 19th century. Exactly why is unclear.
Related commands
DateGives the current date
NowGives the current date and time
TomorrowGives the date tomorrow
YesterdayGives the date yesterday
 Download this web site as a Windows program.




 
Example code : Show the current time
var
  today : TDateTime;
begin
  today := Time;
  ShowMessage('today has date = '+DateToStr(today));
  ShowMessage('today has time = '+TimeToStr(today));
end;
Show full unit code
  today has date = 30/12/1899
  today has time = 13:37:25
 
Delphi Programming © Neil Moffatt . All rights reserved.  |  Home Page