Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EncodeDate in Delphi XE2

Status
Not open for further replies.

MLNorton

Programmer
Nov 15, 2009
134
US
The following code in Delphi 2007 provides the correct integer value of 40909. When run in Delphi XE2 you get the response of 12/30/1899. How can this problem be resolved?
yy: word;
mm: word;
dd: word;
Jan1: TDateTime;
begin
Y := 2012;
M := 1;
D := 1;
Jan1 := EncodeDate(Y,M,D);
 
Can you confirm your code? Your variable declaration shows yy: word; but your code shows Y := 2012;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top