1. Computing & Technology
See More About:
Glossary|Tips/Tricks|FREE App/VCL|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?

Discuss in my forum

©2012 About.com. All rights reserved.

A part of The New York Times Company.