/* Check if the day in the UEFI time is valid. */
BOOLEAN EFIAPI IsDayValid(IN EFI_TIME *Time)
/* Check if the day in the UEFI time is valid. */
BOOLEAN EFIAPI IsDayValid(IN EFI_TIME *Time)
{
  STATIC CONST INTN  DayOfMonth[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
  if ((Time->Day < 1) ||
      (Time->Day > DayOfMonth[Time->Month - 1]) ||
      ((Time->Month == 2) && (!IsLeapYear (Time) && (Time->Day > 28)))
      )
  {
    return FALSE;
  }
  return TRUE;
}