2009. március 6., péntek

Easy way to compare dates


Problem/Question/Abstract:

Did you know that you can easily compare dates by using the "EncodeDate()"?

Answer:

Here are some examples:

uses
  SysUtils;

{...}

if (Date > EncodeDate(1997, 1, 1)) then
begin
  { display "this program has expired" }
end;

{...}

if (EncodeDate(1997, 1, 1) > EncodeDate(1996, 1, 1)) then
begin
  {...}
end;

Nincsenek megjegyzések:

Megjegyzés küldése