Julian Day is defined as the number of days since noon UT on January 1, 4713 BC.
clc; clear all; % Input Date: April 11,2013. UT time 20:11:30 year = 2013; month = 4; day = 11; hour = 20; min = 11; sec = 30;
UT = hour + min/60 + sec/3600; J0 = 367*year - floor(7/4*(year + floor((month+9)/12))) ... + floor(275*month/9) + day + 1721013.5; JD = J0 + UT/24; % Julian Day
RJD = JD - 2400000; % Reduced JD MJD = JD - 2400000.5; % Modified JD, Introduced by SAO in 1957 TJD = JD - 2440000.5; % Truncated JD, Introduced by NASA in 1979 DJD = JD - 2415020; % Dublin JD, Introduced by the IAU in 1955 MSD = (JD - 2405522)/1.02749; % Mars Solar Date
fprintf('Julian Day = %6.4f [days] \n',JD) fprintf('Reduced JD = %6.4f [days] \n',RJD) fprintf('Modified JD = %6.4f [days] \n',MJD) fprintf('Truncated JD = %6.4f [days] \n',TJD) fprintf('Dublin JD = %6.4f [days] \n',DJD) fprintf('Mars Solar Date = %6.4f \n',MSD)
Julian Day = 2456394.3413 [days] Reduced JD = 56394.3413 [days] Modified JD = 56393.8413 [days] Truncated JD = 16393.8413 [days] Dublin JD = 41374.3413 [days] Mars Solar Date = 49511.2763