المشاركات : 211
المواضيع 16
:
: 8
الإنتساب : Jan 2012
السلام عليكم و رحمة الله تعالى و بركاته:
كيف يمكنني حساب الفرق بين تاريخين و النتيجة تكون عدد السنوات و الشهور و الايام مثال:
19/02/2013 و 04/09/2011 و تكون النتيجة: 1 عام و 5 أشهر و 15 يوما
بارك الله فيكم و جزاكم بكل خير
المشاركات : 17
المواضيع 4
:
: 0
الإنتساب : Jun 2010
هذا هو بداية الطريق
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
المشاركات : 211
المواضيع 16
:
: 8
الإنتساب : Jan 2012
بارك الله فيك أخي و جزاك الله بكل خير و جعله في ميزان حسناتك