Can't get EncodeDate function to work.

Posted by Warwick Weston Wright on August 10, 2007

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

The Above Code Snippet doesn't return a propper 'TmpOut' Value. I can use the 'TryEncodeDate' function successfully but I don't need it for this particular part of my program as I pride myself on good programming habbits. Also this code does not return an exception. I am currently using Delphi 2007 Professional(Update 2)

Follow Ups