JulianConversionsGetDate_FromJulian Method

Returns date from Julian Meeus ch. 7

Definition

Namespace: CoordinateSharp
Assembly: CoordinateSharp (in CoordinateSharp.dll) Version: 3.1.1.1
XMLNS for XAML: Not mapped to an xmlns.
C#
public static DateTime? GetDate_FromJulian(
	double j
)

Parameters

j  Double
Julian date

Return Value

NullableDateTime
DateTime

Remarks

The Gregorian calendar (started in 1582) contains different leap year rules than the Julian calendar. To avoid exceptions, any invalid pre-1582 Gregorian leap year conversions of February 29th will shift to March 1st. As such you may see two consecutive Julian to Gregorian conversions produce a date of March 1st on rare occasions.

Example

C#
double jul = 2458484.5;
DateTime? date = JulianConversions.GetDate_FromJulian(jul);
Console.WriteLine(date); //1/1/2019 12:00:00 AM

See Also