1. Computing
Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

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

EncodeDate

unit
Sysutils
category
date/time routines

declaration
function EncodeDate(Year, Month, Day: Word): TDateTime

description
Creates a TDateTime value from Year, Month, and Day values.

The Year must be between 1 and 9999. Valid Month values are 1 through 12. Valid Day values are 1 through 28, 29, 30, or 31, depending on the Month value.
If the function fails, EncodeDate raises an EConvertError exception.

example
var  Y, M, D: Word;
     dt: TDateTime;

y:=2001;
M:=2;
D:=18;

dt:=EncodeDate(Y,M,D);

ShowMessage('Borna will be
             one year old on ' + DateToStr(dt))

in real code

see also
DecodeDate DecodeTime


 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?

©2013 About.com. All rights reserved.