]> git.ipfire.org Git - collecty.git/commitdiff
time: Parse multipliers the other way round
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 29 Oct 2025 15:56:04 +0000 (15:56 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 29 Oct 2025 15:56:04 +0000 (15:56 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/time.c

index 8a3e8d57221fcb0d454b244d4cbd34c86d474aa8..7a92b7516080ab7f20ee7814ec8ea9e9532c4ee6 100644 (file)
@@ -31,29 +31,29 @@ static int find_multiplier(char** p) {
                const char* unit;
                int multiplier;
        } multipliers[] = {
-               { "seconds", 1 },
-               { "second",  1 },
-               { "sec",     1 },
-               { "s",       1 },
-               { "minutes", 60 },
-               { "minute",  60 },
-               { "min",     60 },
-               { "m",       60 },
+               { "years",   3600 * 24 * 365 },
+               { "year",    3600 * 24 * 365 },
+               { "months",  3600 * 24 * 30 },
+               { "month",   3600 * 24 * 30 },
+               { "weeks",   3600 * 24 * 7 },
+               { "week",    3600 * 24 * 7 },
+               { "w",       3600 * 24 * 7 },
+               { "days",    3600 * 24 },
+               { "day",     3600 * 24 },
+               { "d",       3600 * 24 },
                { "hours",   3600 },
                { "hour",    3600 },
                { "hrs",     3600 },
                { "hr",      3600 },
                { "h",       3600 },
-               { "days",    3600 * 24 },
-               { "day",     3600 * 24 },
-               { "d",       3600 * 24 },
-               { "weeks",   3600 * 24 * 7 },
-               { "week",    3600 * 24 * 7 },
-               { "w",       3600 * 24 * 7 },
-               { "months",  3600 * 24 * 30 },
-               { "month",   3600 * 24 * 30 },
-               { "years",   3600 * 24 * 365 },
-               { "year",    3600 * 24 * 365 },
+               { "minutes", 60 },
+               { "minute",  60 },
+               { "min",     60 },
+               { "m",       60 },
+               { "seconds", 1 },
+               { "second",  1 },
+               { "sec",     1 },
+               { "s",       1 },
                { NULL },
        };