From e6c88b74d3b87bbc67beecd1ae8e043320f7c25a Mon Sep 17 00:00:00 2001 From: "Bill(Shuzhou) Liu" Date: Fri, 22 Sep 2023 14:41:22 -0500 Subject: [PATCH] Standard format driver date Normalize the driver date format. Change-Id: I2f9623e99d28217b3cc1a9b6f91cbe77ed66fac9 [ROCm/amdsmi commit: 9fc677a261c1b85d12b5a9f9663acbc5308f89c6] --- projects/amdsmi/src/amd_smi/amd_smi.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/amdsmi/src/amd_smi/amd_smi.cc b/projects/amdsmi/src/amd_smi/amd_smi.cc index 1be040cb20..72d042f9b7 100644 --- a/projects/amdsmi/src/amd_smi/amd_smi.cc +++ b/projects/amdsmi/src/amd_smi/amd_smi.cc @@ -1721,6 +1721,12 @@ amdsmi_status_t amdsmi_get_gpu_driver_info(amdsmi_processor_handle processor_han std::string driver_date; status = gpu_device->amdgpu_query_driver_date(driver_date); if (status != AMDSMI_STATUS_SUCCESS) return r; + + // Reformat the driver date from 20150101 to 2015/01/01 00:00 + if (driver_date.length() == 8) { + driver_date = driver_date.substr(0, 4) + "/" + driver_date.substr(4, 2) + + "/" + driver_date.substr(6, 2) + " 00:00"; + } strncpy(info->driver_date, driver_date.c_str(), AMDSMI_MAX_STRING_LENGTH-1); return status; }