delphi4arab منتديات دلفي للعرب
كيف يتم تحويل الوقت الى عدد صحيح - نسخة قابلة للطباعة

+- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum)
+-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3)
+--- قسم : سؤال و جواب حول دلفي (https://delphi4arab.net/forum/forumdisplay.php?fid=15)
+--- الموضوع : كيف يتم تحويل الوقت الى عدد صحيح (/showthread.php?tid=4979)



كيف يتم تحويل الوقت الى عدد صحيح - Anew - 05-03-2013

السلام عليكم اخواني

كيف يتم تحويل الوقت الى عدد صحيح
00:01:40 و في العدد الصحيح يصبح 100 اي (100) ثانيه
و بارك الله في الجميع


كيف يتم تحويل الوقت الى عدد صحيح - onexite - 05-03-2013

PHP كود :
unit Unit1;
 
interface
 
uses
  SysUtils
,   // Unit containing the DecodeTime command
  
DateUtils,
  
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;
  
myHour, myMin, mySec, myMilli : Word;

begin
  
// Set up the myDate variable to have a December 2000 value
  
myDate := StrToDateTime('29/12/2000 12:45:12.34');

  
// Now add 5 minutes to this value
  
myDate := IncMinute(myDate, 5);

  
// And let us see what we get
  
DecodeTime(myDate, myHour, myMin, mySec, myMilli);
  
ShowMessage('Time now = '+TimeToStr(myDate));
  
ShowMessage('Hour     = '+IntToStr(myHour));
  
ShowMessage('Minute   = '+IntToStr(myMin));
  
ShowMessage('Second   = '+IntToStr(mySec));
  
ShowMessage('MilliSec = '+IntToStr(myMilli));
end; 
وللتحويل الساعات * 3600 + الدقائق * 60 + الثواني
او
PHP كود :
ShowMessage(TimeToStr(Time));
ShowMessage(IntToStr(Trunc((Time) * 86400))); 



كيف يتم تحويل الوقت الى عدد صحيح - Anew - 05-03-2013

بارك الله فيك و ليجعله في ميزان حسنتك

شكرا جزيلا