REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2294
EFI_RUNTIME_SERVICES.GetTime() might return an unspecified Timezone,
such as when SetTime() has not been called after the RTC was cut off
power. Consider this case by not attempting Timezone translations for
when it is invalid.
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Marvin Haeuser <mhaeuser@outlook.de>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
// Change the file time to local time.\r
//\r
Status = gRT->GetTime(&LocalTime, NULL);\r
- if (!EFI_ERROR (Status)) {\r
+ if (!EFI_ERROR (Status) && (LocalTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE)) {\r
if ((Node->Info->CreateTime.TimeZone != EFI_UNSPECIFIED_TIMEZONE) &&\r
(Node->Info->CreateTime.Month >= 1 && Node->Info->CreateTime.Month <= 12)) {\r
//\r