% function [hh,mm] = dec2hrm(dectime)
%
% dec2dhrm converts decimal days into hour and minute.
% The input is, for example, 146.2369, and the output is [05,41].
% 
% Written by Ari W. Epstein in November, 1992.
%
% Modified by J.Manning to eliminate the Julian Day output
%

function [hh,mm] = dec2hrm(dectime)

ddd=fix(dectime);

dechr=dectime-ddd;
hh=fix(dechr*24);

mm=round((dechr*24-hh)*60);

evenhour=find(mm==60);
if(~isempty(evenhour))
    mm(evenhour)=zeros(size(evenhour));
    hh(evenhour)=hh(evenhour)+1;
  end

evenday=find(hh==24);
if (~isempty(evenday))
    hh(evenday)=zeros(size(evenday));
    ddd(evenday)=ddd(evenday)+1;
  end



