function [ y, m, d, h, n, s ] = jed_to_ymdhms_common ( jed )

%*****************************************************************************80
%
%% jed_to_ymdhms_common() converts a JED to a Common YMDHMS date.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 April 2013
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real JED, the Julian Ephemeris Date.
%
%  Output:
%
%    integer Y, M, D, H, N, S, the YMDHMS date.
%
  jed_transition = transition_to_jed_common ( );

  if ( jed <= jed_transition )
    [ y1, m1, d1, f1 ] = jed_to_ymdf_julian ( jed );
  else
    [ y1, m1, d1, f1 ] = jed_to_ymdf_gregorian ( jed );
  end

  [ y, m, d, h, n, s ] = ymdf_to_ymdhms_common ( y1, m1, d1, f1 );

  return
end
