diff --git a/libbbf_api/dmcommon.c b/libbbf_api/dmcommon.c index 3be74938..82dfa746 100644 --- a/libbbf_api/dmcommon.c +++ b/libbbf_api/dmcommon.c @@ -1541,14 +1541,9 @@ int get_shift_time_time(int shift_time, char *local_time, int size) if (t_tm == NULL) return -1; - if (strftime(local_time, size, "%FT%T%z", t_tm) == 0) + if (strftime(local_time, size, "%Y-%m-%dT%H:%M:%SZ", t_tm) == 0) return -1; - local_time[25] = local_time[24]; - local_time[24] = local_time[23]; - local_time[22] = ':'; - local_time[26] = '\0'; - return 0; } @@ -1556,7 +1551,7 @@ int get_shift_time_shift(char *local_time, char *shift) { struct tm tm = {0}; - strptime(local_time,"%FT%T", &tm); + strptime(local_time,"%Y-%m-%dT%H:%M:%SZ", &tm); sprintf(shift, "%u", (unsigned int)(mktime(&tm) - time(NULL))); return 0;