Skip to content

Commit

Permalink
filterx/object-datetime: use the new strftime() implementation
Browse files Browse the repository at this point in the history
Signed-off-by: Balazs Scheidler <[email protected]>
  • Loading branch information
bazsi authored and MrAnno committed Feb 4, 2025
1 parent 3e008db commit 07d3aa4
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions lib/filterx/object-datetime.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,15 +429,8 @@ _strftime_eval(FilterXExpr *s)
size_t date_size = 0;
gchar result_str[MAX_RESULT_STR_LEN];

// TODO - implement wall_clock_time_strftime, because there is some inconsistency with the format accepted by wall_clock_time_strptime
date_size = strftime(result_str, MAX_RESULT_STR_LEN, self->format, &wct.tm);

if (!date_size)
{
return filterx_null_new();
}

return filterx_string_new(result_str, strnlen(result_str, MAX_RESULT_STR_LEN));
date_size = wall_clock_time_strftime(&wct, result_str, MAX_RESULT_STR_LEN, self->format);
return filterx_string_new(result_str, date_size);
}

static FilterXExpr *
Expand Down

0 comments on commit 07d3aa4

Please sign in to comment.