diff --git a/runtime/datetime.c b/runtime/datetime.c index 67392aa96..9faaaf192 100644 --- a/runtime/datetime.c +++ b/runtime/datetime.c @@ -1187,6 +1187,7 @@ int getWeekdayNbr(struct syslogTime *ts) { } wday = ((36525 * g) / 100) + ((306 * f) / 10) + ts->day - 621049; wday %= 7; + if (wday < 0) wday += 7; return wday; } @@ -1391,4 +1392,4 @@ BEGINAbstractObjClassInit(datetime, 1, OBJ_IS_CORE_MODULE) /* class, version */ ENDObjClassInit(datetime) /* vi:set ai: - */ \ No newline at end of file + */