Ver Mensaje Individual
  #1  
Antiguo 26-08-2011
tumama860 tumama860 is offline
Registrado
NULL
 
Registrado: jun 2011
Posts: 3
Reputación: 0
tumama860 Va por buen camino
Exclamation Separar Hora y Minutos de un Campo

Tengo la siguiete duda, tengo un campo TDateTime que lo paso a un Label y me devuelve una hora especifica, en si ese no es el problema, mi duda esta en separar el campo Hora y el campo minutos para guardarlos en una tabla por separado..

Cita:
Procedure TForm28.Button4Click(Sender: TObject);
var
FormatoDelphi,FormatoDelphi2,FormatoDelphi1 : TDateTime;
band1,band2:integer;
begin
band1:=0;
band2:=0;
//validacion campo Hora
if (edit1.text='') or (strtoint(edit1.text)>=24) or (strtoint(edit1.text)<0)then
begin
showmessage('Mal Ingreso de unidades de Hora');
edit1.text:='';
band1:=1;
end
else
band1:=0;
//validacion campo Minutos
if (edit2.text='') or (strtoint(edit2.text)>59)or (strtoint(edit2.text)<0)then
begin
showmessage('Mal Ingreso de unidades de Minuto');
edit2.text:='';
band2:=1;
end
else
band2:=0;


if (band1=0)and(band2=0) then
begin
FormatoDelphi:=strtotime(label4.Caption);
FormatoDelphi1:=strtotime(edit1.text);
FormatoDelphi2:=strtotime('00:'+edit2.text);
label8.caption:=TimeToStr(FormatoDelphi+FormatoDelphi1+FormatoDelphi2);
Ahora en el caption del label8 quiero separar esa hora:Minutos para poder guardarlo...


Desde ya muchas gracias
Saludos
Responder Con Cita