From 75999e05b9878784ee942f5b2e9909397be0c28c Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 2 Mar 2013 21:00:32 -0500 Subject: Fix Anope::Duration showing years failing --- src/misc.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/misc.cpp') diff --git a/src/misc.cpp b/src/misc.cpp index e9e5c68a3..ad8512c56 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -270,7 +270,7 @@ Anope::string Anope::Duration(time_t t, const NickCore *nc) { /* We first calculate everything */ time_t years = t / 31536000; - time_t days = (t / 86400); + time_t days = (t / 86400) % 365; time_t hours = (t / 3600) % 24; time_t minutes = (t / 60) % 60; time_t seconds = (t) % 60; @@ -289,7 +289,7 @@ Anope::string Anope::Duration(time_t t, const NickCore *nc) if (days) { buffer += need_comma ? ", " : ""; - buffer = stringify(days) + " " + (days != 1 ? Language::Translate(nc, _("days")) : Language::Translate(nc, _("day"))); + buffer += stringify(days) + " " + (days != 1 ? Language::Translate(nc, _("days")) : Language::Translate(nc, _("day"))); need_comma = true; } if (hours) -- cgit