--- a/ChangeLog.API Thu Jan 13 23:47:42 2022 -0600
+++ b/ChangeLog.API Fri Jan 14 00:11:38 2022 -0600
@@ -667,6 +667,7 @@
* purple_txt_resolve_account
* PurpleType, use GType instead.
* purple_utf8_salvage. Use g_utf8_make_valid instead.
* purple_util_write_data_to_file_absolute. Use g_file_set_contents
* purple_util_fetch_url_len. Use purple_util_fetch_url, instead.
--- a/finch/gntdebug.c Thu Jan 13 23:47:42 2022 -0600
+++ b/finch/gntdebug.c Fri Jan 14 00:11:38 2022 -0600
@@ -130,8 +130,8 @@
const gchar *search_str = NULL;
GntTextFormatFlags flag = 0;
- const char *mdate = NULL;
+ GDateTime *local_date_time = NULL; + gchar *local_time = NULL; if (debug.window == NULL || debug.paused) {
@@ -165,10 +165,14 @@
pos = gnt_text_view_get_lines_below(GNT_TEXT_VIEW(debug.tview));
- mdate = purple_utf8_strftime("%H:%M:%S ", localtime(&mtime));
- gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(debug.tview), mdate,
+ local_date_time = g_date_time_new_now_local(); + local_time = g_date_time_format(local_date_time, "%H:%M:%S "); + g_date_time_unref(local_date_time); + gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(debug.tview), local_time, gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(debug.tview), domain,
--- a/libpurple/util.c Thu Jan 13 23:47:42 2022 -0600
+++ b/libpurple/util.c Fri Jan 14 00:11:38 2022 -0600
@@ -48,16 +48,13 @@
/**************************************************************************
**************************************************************************/
-purple_utf8_strftime(const char *format, const struct tm *tm)
+purple_date_format_full(const struct tm *tm) - g_return_val_if_fail(format != NULL, NULL);
dt = g_date_time_new_now_local();
@@ -67,12 +64,12 @@
- utf8 = g_date_time_format(dt, format);
+ utf8 = g_date_time_format(dt, "%c"); purple_debug_error("util",
- "purple_utf8_strftime(): Formatting failed\n");
+ "purple_date_format_full(): Formatting failed\n"); @@ -81,12 +78,6 @@
-purple_date_format_full(const struct tm *tm)
- return purple_utf8_strftime("%c", tm);
/**************************************************************************
* Path/Filename Functions
**************************************************************************/
--- a/libpurple/util.h Thu Jan 13 23:47:42 2022 -0600
+++ b/libpurple/util.h Fri Jan 14 00:11:38 2022 -0600
@@ -89,35 +89,6 @@
/**************************************************************************/
- * purple_utf8_strftime:
- * @format: The format string, in UTF-8
- * @tm: The time to format, or %NULL to use the current local time
- * Formats a time into the specified format.
- * This is essentially strftime(), but it has a static buffer
- * and handles the UTF-8 conversion for the caller.
- * This function also provides the GNU \%z formatter if the underlying C
- * library doesn't. However, the format string parser is very naive, which
- * means that conversions specifiers to \%z cannot be guaranteed. The GNU
- * strftime(3) man page describes \%z as: 'The time-zone as hour offset from
- * GMT. Required to emit RFC822-conformant dates
- * (using "\%a, \%d \%b \%Y \%H:\%M:\%S \%z"). (GNU)'
- * On Windows, this function also converts the results for \%Z from a timezone
- * name (as returned by the system strftime() \%Z format string) to a timezone
- * abbreviation (as is the case on Unix). As with \%z, conversion specifiers
- * Note: @format is required to be in UTF-8. This differs from strftime(),
- * where the format is provided in the locale charset.
- * Returns: The formatted time, in UTF-8.
-const char *purple_utf8_strftime(const char *format, const struct tm *tm);
* purple_date_format_full:
* @tm: The time to format, or %NULL to use the current local time
--- a/pidgin/pidgindebug.c Thu Jan 13 23:47:42 2022 -0600
+++ b/pidgin/pidgindebug.c Fri Jan 14 00:11:38 2022 -0600
@@ -689,8 +689,8 @@
const gchar *domain = NULL;
const gchar *arg_s = NULL;
GtkTextTag *level_tag = NULL;
- const char *mdate = NULL;
+ GDateTime *local_date_time = NULL; + gchar *local_time = NULL; @@ -732,17 +732,21 @@
gtk_text_buffer_get_end_iter(debug_win->buffer, &end);
gtk_text_buffer_move_mark(debug_win->buffer, debug_win->start_mark, &end);
- mdate = purple_utf8_strftime("(%H:%M:%S) ", localtime(&mtime));
+ local_date_time = g_date_time_new_now_local(); + local_time = g_date_time_format(local_date_time, "(%H:%M:%S) "); + g_date_time_unref(local_date_time); gtk_text_buffer_insert_with_tags(
debug_win->paused ? debug_win->tags.paused : NULL,
if (domain != NULL && *domain != '\0') {
gtk_text_buffer_insert_with_tags(