Fix timestamp to match ISO8061 format
Timestamp needs to match ISO8061 to match compatibility standards. Add
UTC timezone.
Change-Id: I8ec314d87f90e8f261979a1b6efbd05ed8beb514
Signed-off-by: Aushim Nagarkatti <anagarkatti@nvidia.com>
diff --git a/cper-utils.c b/cper-utils.c
index ed21f87..94fe08e 100644
--- a/cper-utils.c
+++ b/cper-utils.c
@@ -242,7 +242,7 @@
//Output must be at least TIMESTAMP_LENGTH bytes long.
void timestamp_to_string(char *out, EFI_ERROR_TIME_STAMP *timestamp)
{
- sprintf(out, "%02hhu%02hhu-%02hhu-%02hhuT%02hhu:%02hhu:%02hhu.000",
+ sprintf(out, "%02hhu%02hhu-%02hhu-%02hhuT%02hhu:%02hhu:%02hhu+00:00",
bcd_to_int(timestamp->Century) %
100, //Cannot go to three digits.
bcd_to_int(timestamp->Year) % 100, //Cannot go to three digits.
@@ -259,7 +259,7 @@
return;
}
- sscanf(timestamp, "%2hhu%2hhu-%hhu-%hhuT%hhu:%hhu:%hhu.000",
+ sscanf(timestamp, "%2hhu%2hhu-%hhu-%hhuT%hhu:%hhu:%hhu+00:00",
&out->Century, &out->Year, &out->Month, &out->Day, &out->Hours,
&out->Minutes, &out->Seconds);