Delphi Programming

  1. Home
  2. Computing & Technology
  3. Delphi Programming
Glossary|Tips/Tricks|FREE App/VCL|Essentials|Books|Link Back

Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
 

TDateTime type

unit
SysUtils
category
Floating point conversion routines

declaration
type TDateTime = type Double;

description
Represents a date and time value.

A TDateTime value is stored as a Double value variable. The integral part represents a date part, time part is held in fractional part. The date part of the TDateTime variable represents the number of days that have passed since 12/30/1899.

Because TDateTime is actually a double value, we can perform "number" calculations on it. To find the fractional number of days between two dates, simply subtract the two values.

example
var aDateTime, AnotherDateTime : TDateTime;

aDateTime := Now;

AnotherDateTime := aDateTime + 1;
//one day in the future 


in real code

see also
DateTimeToStr, DateTimeToFileDate,


 Free Delphi code snippet inside every Delphi Newsletter!
Subscribe to the Newsletter
Name
Email

 Got some code to share? Got a question? Need some help?

Explore Delphi Programming

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Delphi Programming

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

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

All rights reserved.