I have created a simple form in Delphi 2010 with a single button in the code for the button I put:
procedure TForm1.Button1Click(Sender: TObject);
var
myDateTime:TDateTime;
begin
myDateTime:=now; // shows as 12/30/99 in debugger
end;
When I run this exact same code in Delphi XE2, I get the current date/time in the value for myDateTime.
I'm thinking I must have something set incorrectly in the Delphi 2010 project environment, but cannot think of what it might be.
Any help would be much appreciated.
Thanks!
Discovered issue, compiler settings were for Code Generation Optimization set to true, and the value apparently gets represented as the default for TDateTime. When I changed the optimization setting to false, I can see the value.