How Do I Directly Initialize A TDateTime Value

Posted by Warwick Weston Wright on August 10, 2007

In Reply to Can't get EncodeDate function to work. posted by Warwick Weston Wright on August 10, 2007

Function STFuncs.IsValidDateDV(SenderDV:String):Boolean;//0
var
TmpOut:TDateTime;
FmtSettings:TFormatSettings;
MyYY,MyMM,MyDD:Word;
begin
// TmpOut:=TDateTime(TmpOut);
GetLocaleFormatSettings(0, FmtSettings);
FormatDateTime(FmtSettings.ShortDateFormat,TmpOut,FmtSettings);
DecodeDate(25194,MyYY,MyMM,MyDD);
//TryEncodeDate(MyYY,MyMM,MYDD,TmpOut);
TmpOut:=EncodeDate(MyYY,MyMM,MYDD);
end;

Thanks for your prompt answer Jerry. I Know The Function doesn't make sense. I just copied the gobeldygook that I was playing with at the time. I want to know how to initialise A TDateTime value directly without without using the TryEncodeDate Fucntion. I would asume that TryEncode probaby indirectly calls the constructor of the TDateTime. The onlyline help In Delphi 2007 Pro is nigh on useless.

Follow Ups