From e43aea35cce96d434ded9b2607ac09b76eb20323 Mon Sep 17 00:00:00 2001 From: Felix Brucker Date: Tue, 2 Oct 2018 21:05:09 +0200 Subject: [PATCH] Use localtime instead of utc --- src/plugins/mod_chat_history_sqlite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/mod_chat_history_sqlite.c b/src/plugins/mod_chat_history_sqlite.c index c64d8b5..131861b 100644 --- a/src/plugins/mod_chat_history_sqlite.c +++ b/src/plugins/mod_chat_history_sqlite.c @@ -142,7 +142,7 @@ void user_login(struct plugin_handle* plugin, struct plugin_user* user) struct cbuffer* buf = NULL; struct linked_list* found = (struct linked_list*) list_create(); - sql_execute(data, get_messages_callback, found, "SELECT * FROM chat_history ORDER BY time DESC LIMIT 0,%d;", (int) data->history_connect); + sql_execute(data, get_messages_callback, found, "SELECT from_nick,message, datetime(time, 'localtime') as time FROM chat_history ORDER BY time DESC LIMIT 0,%d;", (int) data->history_connect); if (data->history_connect > 0 && list_size(found) > 0) { @@ -180,7 +180,7 @@ static int command_history(struct plugin_handle* plugin, struct plugin_user* use else maxlines = data->history_default; - sql_execute(data, get_messages_callback, found, "SELECT * FROM chat_history ORDER BY time DESC LIMIT 0,%d;", maxlines); + sql_execute(data, get_messages_callback, found, "SELECT from_nick,message, datetime(time, 'localtime') as time FROM chat_history ORDER BY time DESC LIMIT 0,%d;", maxlines); size_t linecount = list_size(found);