Amigos del club he solucionado el problema de la siguiente manera, quizás no es la mas optima pero para mi problema esta OK, ya que necesito mostrar el día en un campo y la hora en otro aquí mando código por si alguien lo necesitara.
Gracias
Código Delphi
[-]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, DateUtils;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
DateTimePicker1: TDateTimePicker;
DateTimePicker2: TDateTimePicker;
Label2: TLabel;
DateTimePicker3: TDateTimePicker;
DateTimePicker4: TDateTimePicker;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
fecha : string;
Tfecha1 : TDateTime;
Tfecha2 : TDateTime;
begin
fecha := datetostr(DateTimePicker1.Date) + ' ' +
timetostr(DateTimePicker2.time);
Label1.Caption := fecha;
Tfecha1 := strtodatetime(fecha);
Label2.Caption := datetimetostr(Tfecha1);
fecha := datetostr(DateTimePicker3.Date) + ' ' +
timetostr(DateTimePicker4.time);
Label3.Caption := fecha;
Tfecha2 := strtodatetime(fecha);
Label4.Caption := datetimetostr(Tfecha2);
Label5.Caption := inttostr(HoursBetween(tfecha2 , tfecha1));
end;
end.