DATE2MJD Modified Julian day number. MJD = DATE2MJD(YEAR, MONTH, DAY, HOUR, MINUTE, SECOND) returns the modified Julian day number of the given date plus a fractional part depending on the day and time of day. Any missing MONTH or DAY will be replaced by ones. Any missing HOUR, MINUTE or SECOND will be replaced by zeros. If no date is specified, the current date and time is used. Gregorian calendar is assumed. Start of the MJD (modified Julian day) count is from 0 at 00:00 UTC 17 November 1858 (Gregorian calendar).
0001 function mjd = date2mjd(varargin) 0002 %DATE2MJD Modified Julian day number. 0003 % 0004 % MJD = DATE2MJD(YEAR, MONTH, DAY, HOUR, MINUTE, SECOND) returns the 0005 % modified Julian day number of the given date plus a fractional part 0006 % depending on the day and time of day. 0007 % 0008 % Any missing MONTH or DAY will be replaced by ones. Any missing HOUR, 0009 % MINUTE or SECOND will be replaced by zeros. 0010 % 0011 % If no date is specified, the current date and time is used. Gregorian 0012 % calendar is assumed. 0013 % 0014 % Start of the MJD (modified Julian day) count is from 0 at 00:00 UTC 17 0015 % November 1858 (Gregorian calendar). 0016 0017 % Author: Peter J. Acklam 0018 % Time-stamp: 2002-03-03 12:52:13 +0100 0019 % E-mail: pjacklam@online.no 0020 % URL: http://home.online.no/~pjacklam 0021 0022 mjd = date2jd(varargin{:}) - 2400000.5;