/* See if all fields of a variable of EFI_TIME type is correct. */
EFI_STATUS RtcTimeFieldsValid(IN EFI_TIME *Time)
/* See if all fields of a variable of EFI_TIME type is correct. */
EFI_STATUS RtcTimeFieldsValid(IN EFI_TIME *Time)
{
  if ((Time->Year < mMinimalValidYear) ||
      (Time->Year > mMaximalValidYear) ||
      (Time->Month < 1) ||
      (Time->Month > 12) ||
      (!DayValid (Time)) ||
      (Time->Hour > 23) ||
      (Time->Minute > 59) ||
      (Time->Second > 59) ||
      (Time->Nanosecond > 999999999) ||
      (!((Time->TimeZone == EFI_UNSPECIFIED_TIMEZONE) || ((Time->TimeZone >= -1440) && (Time->TimeZone <= 1440)))) ||
      ((Time->Daylight & (~(EFI_TIME_ADJUST_DAYLIGHT | EFI_TIME_IN_DAYLIGHT))) != 0))
  {
    return EFI_INVALID_PARAMETER;
  }
  return EFI_SUCCESS;
}