function [ y2, m2, d2, h2, n2, s2 ] = ymdf_to_ymdhms_common ( y1, m1, d1, f1 )

%*****************************************************************************80
%
%% YMDF_TO_YMDHMS_COMMON converts from YMDF to YMDHMS in the Common calendar.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 April 2013
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer Y1, M1, D1, real F1, the YMDF date.
%
%  Output:
%
%    integer Y2, M2, D2, H2, N2, S2, the YMDHMS date.
%

%
%  Check the date.
%
  [ y1, m1, d1, f1, ierror ] = ymdf_check_common ( y1, m1, d1, f1 );

  if ( ierror ~= 0 )
    fprintf ( 1, '\n' );
    fprintf ( 1, 'YMDF_TO_YMDHMS_COMMON - Fatal error%\n' );
    error ( 'YMDF_TO_YMDHMS_COMMON - Fatal error%' );
  end

  y2 = y1;
  m2 = m1;
  d2 = d1;

  f2 = f1;
  f2 = f2 * 24.0;
  h2 = floor ( f2 );
  f2 = f2 - h2;
  f2 = f2 * 60.0;
  n2 = floor ( f2 );
  f2 = f2 - n2;
  f2 = f2 * 60.0;
  s2 = round ( f2 );

  return
end
