Use localtime instead of utc

This commit is contained in:
Felix Brucker 2018-10-02 21:05:09 +02:00 committed by Jan Vidar Krey
parent d54d723c59
commit e43aea35cc

View File

@ -142,7 +142,7 @@ void user_login(struct plugin_handle* plugin, struct plugin_user* user)
struct cbuffer* buf = NULL; struct cbuffer* buf = NULL;
struct linked_list* found = (struct linked_list*) list_create(); 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) 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 else
maxlines = data->history_default; 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); size_t linecount = list_size(found);