Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Date and Time

Status
Not open for further replies.

Nordlund

Programmer
Jul 17, 2001
458
SE
Hi all...

If I have 2 TDateTimePicker components, One showing time, another showing date.

How the heck do I adding the time and the date?

Have fun, keep on playing......
 
Ok. I've got my own solution, but is there another, better way to solve it?


var
T1, T2: TTimeStamp;
theDate: TDateTime;
begin
T1 := DateTimeToTimeStamp(DatePicker.Date);
T2 := DateTimeToTimeStamp(TimePicker.Date);
T1.Time := T2.Time;
theDate := TimeStampToDateTime(T1);
end;
 
And onther 3rd better way is to erase the Date portion in the TimePicker and the Time portion in the Date Picker...


Thanks Mats... ;)
 
Yep. that did the trick, but before I got it to work, I had to remove the time on the date component and vice versa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top