chami.com/tips/
Last  Home  Next
 Internet
 Programming
 Windows


Click for details
Keywords
Delphi 2.x
Delphi 3.x
Delphi
Functions
Source Code

Downloads
datecomp.pas

Easy way to compare dates

Did you know that you can easily compare dates by using the "EncodeDate()"? 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;
Listing #1 : Delphi code. Right click datecomp.pas to download.
 
Related Links Email Print 
Created on 29-Oct-1996. Source code colorized using CodeColorizer.
Copyright (C) 1996-99 Chami.com All Rights Reserved. Reproduction in whole or in part
or in any form or medium without express written permission of Chami.com is prohibited.
Information on this page is provided as-is without warranty of any kind. Use at your own risk.
Free Downloads | Products & Services | Privacy Statement | Terms & Conditions | Advertising Info