summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorGravatar Patrick Griffis <tingping@tingping.se>2015-12-26 21:38:50 -0500
committerGravatar Patrick Griffis <tingping@tingping.se>2016-01-19 19:35:10 -0500
commita58b32a5b362f5059c697d9ff39b7fcee536a4df (patch)
tree3293aac99da813ca9e220a599a300228112f154f /src/util.c
parent0e186c2d2dd20437064dbb52320d76bf84845fd7 (diff)
Start modernizing GObject usage
Long way to go...
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/util.c b/src/util.c
index 3e13108..d45822c 100644
--- a/src/util.c
+++ b/src/util.c
@@ -494,18 +494,10 @@ int tr_snprintf(char *buf, size_t buflen, const char *fmt, ...)
gchar *epoch_to_string(gint64 epoch)
{
-#if GLIB_CHECK_VERSION(2, 26, 00)
GDateTime *dt = g_date_time_new_from_unix_local(epoch);
gchar *timestring = g_date_time_format(dt, "%F %H:%M:%S");
g_date_time_unref(dt);
return timestring;
-#else
- char buf[64];
- time_t time_val = epoch;
- struct tm *ts = localtime(&time_val);
- int wrote = strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", ts);
- return g_strndup(buf, wrote);
-#endif
}
/* wrap a link in text with a hyperlink, for use in pango markup.