ScriptCore3.EncodeDate

From Soldat Community Wiki
Jump to: navigation, search
function EncodeDate(Year, Month, Day: Word): TDateTime;
 Year: Year to be encoded
 Month: Month to be encoded
 Day: Day to be encoded
 Result: TDateTime depending on provided Year, Month and Day

Description

This function allows to convert given Year, Month and Day into a TDateTime format.
Note that arguments are not decimal numbers.

Example

var
  y,m,d: Word;
  currdate: TDateTime;
begin
  // today (for me) it's 25th August 2013
  y := 2013;
  m := 8;
  d := 25;
  
  currdate := EncodeDate(y,m,d);
  WriteLn(FormatFloat('0',currdate));
  // 41511
end.