DelphiBasics
Now
Function
Gives the current date and time SysUtils unit
 function Now():TDateTime;
Description
The Now function returns the current date and time in the local time zone.
 
The returned TDateTime type can be manipulated and displayed by many SysUtil and DateUtils routines.
Related commands
DateGives the current date
TimeGives the current time
TomorrowGives the date tomorrow
YesterdayGives the date yesterday
 Download this web site as a Windows program.




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