كيف حساب الفرق بين تاريخين و النتيجة تكون عدد السنوات و الشهور و الايام
#2
هذا هو بداية الطريق

PHP كود :
unit Unit1;
 
interface
 
uses
  DateUtils
,   // Unit containing the IncYear command
  
SysUtils,
  
Forms, Dialogs;
 
type
  TForm1 
= class(TForm)
    
procedure FormCreate(Sender: TObject);
  
end;
 
var
  
Form1: TForm1;
 
implementation
{$R *.dfm} // Include form definitions
 
procedure TForm1.FormCreate(Sender: TObject);
var
  
myDate : TDateTime;
begin
  
// Set up our date to a leap year special day
  
myDate := EncodeDate(2000, 02, 29);
  
ShowMessage('myDate = '+DateToStr(myDate));

  
// Add 2 years to this date
  
myDate := IncYear(myDate, 2);
  
ShowMessage('myDate + 2 years = '+DateToStr(myDate));

  
// Subtract 2 years from this date
  
myDate := IncYear(myDate, -2);
  
ShowMessage('myDate - 2 years = '+DateToStr(myDate));
end;
 
end. 

أيضا يمكنك إستخدام هذه الاوامر

PHP كود :
IncDay         Increments a TDateTime variable by + or - number of days
IncMinute         Increments a TDateTime variable by 
+ or - number of minutes
IncMonth         Increments a TDateTime variable by a number of months
IncSecond         Increments a TDateTime variable by 
+ or - number of seconds
IncMillisecond         Increments a TDateTime variable by 
+ or - number of milliseconds 
الرد


الردود في هذا الموضوع
كيف حساب الفرق بين تاريخين و النتيجة تكون عدد السنوات و الشهور و الايام - بواسطة iNjECTOR - 19-02-2013, 06:46 PM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم