ecma_date_make_time (ecma_number_t hour, /**< hour value */
                     ecma_number_t min, /**< minute value */
                     ecma_number_t sec, /**< second value */
                     ecma_number_t ms) /**< millisecond value */
{
  if (!ecma_number_is_finite (hour)
      || !ecma_number_is_finite (min)
      || !ecma_number_is_finite (sec)
      || !ecma_number_is_finite (ms))
  {
    return ecma_number_make_nan ();
  }

  ecma_number_t h = ecma_number_trunc (hour);
  ecma_number_t m = ecma_number_trunc (min);
  ecma_number_t s = ecma_number_trunc (sec);
  ecma_number_t milli = ecma_number_trunc (ms);

  return (ecma_number_t) ((h * ECMA_DATE_MS_PER_HOUR
                          + m * ECMA_DATE_MS_PER_MINUTE
                          + s * ECMA_DATE_MS_PER_SECOND
                          + milli));
} /* ecma_date_make_time */
ecma_date_make_time (ecma_number_t hour,  
                     ecma_number_t min,  
                     ecma_number_t sec,  
                     ecma_number_t ms)  
{
  if (!ecma_number_is_finite (hour)
      || !ecma_number_is_finite (min)
      || !ecma_number_is_finite (sec)
      || !ecma_number_is_finite (ms))
  {
    return ecma_number_make_nan ();
  }

  ecma_number_t h = ecma_number_trunc (hour);
  ecma_number_t m = ecma_number_trunc (min);
  ecma_number_t s = ecma_number_trunc (sec);
  ecma_number_t milli = ecma_number_trunc (ms);

  return (ecma_number_t) ((h * ECMA_DATE_MS_PER_HOUR
                          + m * ECMA_DATE_MS_PER_MINUTE
                          + s * ECMA_DATE_MS_PER_SECOND
                          + milli));
}  