diff options
| author | 2019-07-04 10:30:23 -0600 | |
|---|---|---|
| committer | 2019-07-04 17:30:23 +0100 | |
| commit | 3b8246ab07faa673bf4e11b8aa927a9d724aa7d3 (patch) | |
| tree | 793d60dcfabb6e6d7e624a67868c8b4c2457cfa2 /src/helperfuncs.cpp | |
| parent | Use DurationString() in the 'Replaying ...' message. (diff) | |
| download | inspircd++-3b8246ab07faa673bf4e11b8aa927a9d724aa7d3.tar.gz inspircd++-3b8246ab07faa673bf4e11b8aa927a9d724aa7d3.tar.bz2 inspircd++-3b8246ab07faa673bf4e11b8aa927a9d724aa7d3.zip | |
Fix years being offset from weeks (#1678).
Currently a duration of 52w will return a blank string.
When I added weeks to the calculations, I failed to update
the number of seconds to a year. As 365 days and 52 weeks
aren't the same, but the calculation needs to be consistent.
Diffstat (limited to 'src/helperfuncs.cpp')
| -rw-r--r-- | src/helperfuncs.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 846feab50..386d6dafc 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -432,7 +432,7 @@ bool InspIRCd::IsValidDuration(const std::string& duration) std::string InspIRCd::DurationString(time_t duration) { - time_t years = duration / 31536000; + time_t years = duration / 31449600; time_t weeks = (duration / 604800) % 52; time_t days = (duration / 86400) % 7; time_t hours = (duration / 3600) % 24; |
