ecma_date_week_day (ecma_number_t time) /**< time value */
{
  JERRY_ASSERT (!ecma_number_is_nan (time));

  int32_t day = ecma_date_day_from_time (time);

  int week_day = (day + 4) % 7;

  return week_day >= 0 ? week_day : week_day + 7;
} /* ecma_date_week_day */
ecma_date_week_day (ecma_number_t time)  
{
  JERRY_ASSERT (!ecma_number_is_nan (time));

  int32_t day = ecma_date_day_from_time (time);

  int week_day = (day + 4) % 7;

  return week_day >= 0 ? week_day : week_day + 7;
}  