1. Home
  2. Computing & Technology
  3. Delphi Programming

From TTime and TDate to TDateTime

By , About.com Guide

Here's how to combine TTime and TDate to single TDateTime value:

~~~~~~~~~~~~~~~~~~~~~~~~~
var
  DateValue : TDate;
  TimeValue: TTime;
  OutDateTime : TDateTime;
...
   // OutDateTime combines DateValue and TimeValue
   OutDateTime := Int(DateValue) + Frac(TimeValue) ;

~~~~~~~~~~~~~~~~~~~~~~~~~

Delphi tips navigator:
» How to show week numbers in a TDateTimePicker
« Implementing C#'s foreach loop in Delphi 8

Explore Delphi Programming
About.com Special Features

Reader's Choice Award Winners

What are the best instant messengers, apps, editors and more? You told us, for our 2010 technology awards program. More >

iPad Central

Is Apple's new tablet computer impractical, a must-have -- or both? We'll help you figure it out. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. 2004 Delphi Tips
  7. From TTime and TDate to TDateTime

©2010 About.com, a part of The New York Times Company.

All rights reserved.