Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function EncodeDate(Year, Month, Day: Word): TDateTime
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.
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))
|
DecodeDate
DecodeTime
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|