function theDateNum = julian2datenum(theJulian) % julian2datenum -- Convert Julian Day to Matlab datenum. % julian2datenum(theJulian) converts theJulian decimal % day to its equivalent Matlab datenum. The Julian % day is referenced to midnight, not noon. % Copyright (C) 1998 Dr. Charles R. Denham, ZYDECO. % All Rights Reserved. % Disclosure without explicit written consent from the % copyright owner does not constitute publication. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Use of this program is self described. % Program written in Matlab v7.1.0 SP3 % Program ran on PC with Windows XP Professional OS. % % "Although this program has been used by the USGS, no warranty, % expressed or implied, is made by the USGS or the United States % Government as to the accuracy and functioning of the program % and related program material nor shall the fact of distribution % constitute any such warranty, and no responsibility is assumed % by the USGS in connection therewith." %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Version of 26-Oct-1998 15:49:22. if nargin < 1, help(mfilename), return, end t0 = datenum(1968, 5, 23) - 2440000; % May 23, 1968. result = theJulian + t0; if nargout > 0 theDateNum = result; else disp(result) end