كيف يتم تحويل الوقت الى عدد صحيح
#1
السلام عليكم اخواني

كيف يتم تحويل الوقت الى عدد صحيح
00:01:40 و في العدد الصحيح يصبح 100 اي (100) ثانيه
و بارك الله في الجميع
الرد
#2
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))); 
الرد
#3
بارك الله فيك و ليجعله في ميزان حسنتك

شكرا جزيلا
الرد


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


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