OptDate Function
A Speed Optimised Routine to get the Current Date.

Unit
QESBPCSDateTime

Declaration
Function OptDate: TDateTime;

Description
Time Portion is Zero. Better to use ESBToday as that is the newer name of this routine.

Category
Date/Time Arithmetic Routines

Implementation

function OptDate: TDateTime;
{$IFDEF MSWINDOWS}
var
     ST: TSystemTime;
begin
     Windows.GetLocalTime (ST);
     Result := OptEncodeDateW (ST.wYear, ST.wMonth, ST.wDay);
end;
{$ENDIF}
{$IFDEF LINUX}
var
     T: TTime_T;
     UT: TUnixTime;
begin
     __time (@T);
     localtime_r (@T, UT);
     Result := OptEncodeDateI (UT.tm_year + 1900, UT.tm_mon + 1, UT.tm_mday);
End;


HTML generated by Time2HELP
http://www.time2help.com