- % Gregorian Date from Julian Date
- % This calculation is valid for any Julian Day Number including negative JDN and
- % produces a Gregorian date (or possibly a proleptic Gregorian date)
- Z = floor(JD0 - 1721118.5); % JD0 is the Julian Date in propagation
- R = (JD0 - 1721118.5 - Z); % R is the fractional part of JD0
- G = (Z - .25);
- A = (floor(G / 36524.25)); % Calculate the value of A which is the number of full centuries
- B = (A - (A / 4)); % The value of B is this number of days minus a constant
- year = (floor((B+G) / 365.25)); % Calculate the value of Y, the year in a calendar whose years start on March 1
- C = (B + Z - floor(365.25 * year)); % Day count
- month = (fix((5 * C + 456) / 153)); % Month
- UT = (C - fix((153 * month - 457) / 5) + R); % Calculation for UTC
- day = floor(UT); % Gregorian Day
儒略日转公历算法
最新推荐文章于 2022-07-17 21:52:16 发布