The reverse of DateTimeToJulianDate, this function JulianDateToDateTime converts a Julian Date into its corresponding TDateTime value.

A Julian date (or Julian Day) is a number that refers to the number of days, including fractional days, that have elapsed since a particular historical point in time. The current Julian cycle started at Greenwich noon on January 1, 4713 B.C. (Gregorian calendar), and will end on January 22, 3268 A.D.

Julian date is commonly used by astronomers, geophysicists, and others, and used in computer science to calculate the difference between days, since all numbers in the system are consecutive integers.

For example, the Julian date for December 11, 1942 is 2430705; while December 12, 1942 is 2430706.

Where the specified Julian Date AValue cannot be converted, JulianDateToDateTime raises an exception error.

Declaration: function JulianDateToDateTime(const AValue: Double): TDateTime;

Here is an easy example.

procedure OnMapEvent(var Value:Variant);
var
TheDate : TDateTime;
TheJDate : double;
begin
//Returns 'The Julian 2460284.5 is 06-12-2023 00:00:00.000'
TheJDate := 2460284.5;
TheDate := JulianDateToDateTime(TheJDate);
LogInfo('The Julian '+FloatToStr(TheJDate)+' is '+FormatDateTime('dd-mm-yyyy hh:nn:ss.zzz', TheDate));
 
//Returns 'The Julian 2460284.33456785 is 05-12-2023 20:01:46.662'
TheJDate := 2460284.33456785;
TheDate := JulianDateToDateTime(TheJDate);
LogInfo('The Julian '+FloatToStr(TheJDate)+' is '+FormatDateTime('dd-mm-yyyy hh:nn:ss.zzz', TheDate));
 
//Returns 'The Julian 2430706 is 12-12-1942 12:00:00.000'
TheJDate := 2430706;
TheDate := JulianDateToDateTime(TheJDate);
LogInfo('The Julian '+FloatToStr(TheJDate)+' is '+FormatDateTime('dd-mm-yyyy hh:nn:ss.zzz', TheDate));
end;

Please also refer to DateTimeToJulianDate.