Mercurial > pidgin
diff plugins/timestamp_format.c @ 13104:e1e5462b7d81
[gaim-migrate @ 15466]
Rework lots of date parsing. I either introduced a whole lot of bugs, or I've made sure all dates are localized properly now. Only time will tell which it is... ;)
committer: Tailor Script <tailor@pidgin.im>
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Thu, 02 Feb 2006 19:50:51 +0000 |
| parents | b553326bc468 |
| children | c73c7dd0721f |
line wrap: on
line diff
--- a/plugins/timestamp_format.c Thu Feb 02 19:39:12 2006 +0000 +++ b/plugins/timestamp_format.c Thu Feb 02 19:50:51 2006 +0000 @@ -3,6 +3,7 @@ #include "debug.h" #include "log.h" #include "plugin.h" +#include "util.h" #include "version.h" #include "gtkconv.h" @@ -55,8 +56,6 @@ gboolean force, const char *dates) { - char buf[64]; - g_return_val_if_fail(conv != NULL, NULL); g_return_val_if_fail(tm != NULL, NULL); g_return_val_if_fail(dates != NULL, NULL); @@ -67,18 +66,13 @@ (time(NULL) > (mktime((struct tm *)tm) + 20*60))) { if (force) - strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm); + return g_strdup(gaim_utf8_strftime("%Y-%m-%d %H:%M:%S", tm)); else - strftime(buf, sizeof(buf), "%x %X", tm); - - return g_strdup(buf); + return g_strdup(gaim_date_format_long(tm)); } if (force) - { - strftime(buf, sizeof(buf), "%H:%M:%S", tm); - return g_strdup(buf); - } + return g_strdup(gaim_utf8_strftime("%Y-%m-%d %H:%M:%S", tm)); return NULL; } @@ -111,11 +105,7 @@ if (log->type == GAIM_LOG_SYSTEM) { if (force) - { - char buf[64]; - strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm); - return g_strdup(buf); - } + return g_strdup(gaim_utf8_strftime("%Y-%m-%d %H:%M:%S", tm)); else return NULL; }
