I know you can get the current date and time using the Now() function, but how would you get the date of yesterday?
>Solution :
You can use the Yesterday function from DateUtils as follow:
uses DateUtils;
begin
ShowMessage('Yesterday = ' + DateToStr(Yesterday)); // Date of yesterday
ShowMessage('Today = ' + DateToStr(Date)); // Date of Today
ShowMessage('Tomorrow = ' + DateToStr(tomorrow)); // Date of tomorrow
end;
These functions return a TDateTime data type. The time component is set to zero.