function DateToTicks(year, month, day: Integer): Int64;
var
num, num2: Integer;
begin
Result := 0;
if ((year >= 1) and (year <= $270f)) and ((month >= 1) and (month <= 12)) then
begin
if (day >= 1) and (day <= (DaysToMonth[IsLeapYear(year)][month] -
DaysToMonth[IsLeapYear(year)][month - 1])) then
begin
num := year - 1;
num2 := ((((((num * $16d) + (num div 4)) - (num div 100)) +
(num div 400)) + DaysToMonth[IsLeapYear(year)][month - 1]) + day) - 1;
Result := num2 * $c92a69c000;
end;
end;
end;
function TimeToTicks(hour, minute, second, millisecond: Integer): Int64;
var
num: Int64;
begin
Result := 0;
if (((hour < 0) or (hour >= $18)) or ((minute < 0) or (minute >= 60))) or
((second < 0) or (second >= 60)) then Exit;
num := ((hour * $e10) + (minute * 60)) + second;
Result := num * $989680 + (Int64(millisecond * $989680) div 1000);
end;
var
SystemTime: TSystemTime;
result:real;
begin
GetLocalTime(SystemTime);
With SystemTime do
result:=(wHour*3600+wMinute*60+wSecond)/(3600*24);
ShowMessage(FloatToStr(result));
end;