0001 function filetime = gettime_jd(filename,filepath,test)
0002
0003
0004
0005
0006 if nargin < 3,
0007 test = false;
0008 end
0009
0010 if nargin < 2 || isempty(filepath),
0011 filepath = './';
0012 end
0013
0014 files = dir(filepath);
0015 filetime = 0;
0016
0017 for ifile = 1:length(files),
0018 if strcmp(files(ifile).name,filename),
0019 if isfield(files(ifile),'datenum'),
0020 filetime = files(ifile).datenum;
0021 else
0022 filetime = datenum(files(ifile).date);
0023 end
0024 return
0025 end
0026 end
0027
0028 if test,
0029 error(['The source file ',filename,' was not found in ',filepath])
0030 end