function [ MDJ ] = mdj(Y,M,D)
  if M<=2 
    Y=Y-1;
    M=M+12;
  end
  i=fix(Y/100);
  k=2-i+fix(i/4);

  MDJ=fix(365.25*Y)-679006+fix(30.6001*(M+1))+k+D;
end

