summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-03-02 21:00:32 -0500
committerAdam <Adam@anope.org>2013-03-02 23:42:00 -0500
commit75999e05b9878784ee942f5b2e9909397be0c28c (patch)
tree3a586e6bdf84347a9819c975f10f44754db4f456
parent45c02f8e4e8d8a6915c3d937da2d3c6f46224b76 (diff)
Fix Anope::Duration showing years failing
-rw-r--r--src/misc.cpp4
1 files changed, 2 insertions, 2 deletions
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)