From f6a9b5adb12fe92ebaaa20d9707d7945406ae533 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 22 Apr 2018 21:00:58 +1000 Subject: src/loslib.js: Fix off-by-one error in month field of os.time() --- src/loslib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/loslib.js b/src/loslib.js index c282175..d20873d 100644 --- a/src/loslib.js +++ b/src/loslib.js @@ -73,7 +73,7 @@ const setallfields = function(L, time, utc) { setfield(L, "min", !utc ? time.getMinutes() : time.getUTCMinutes()); setfield(L, "hour", !utc ? time.getHours() : time.getUTCHours()); setfield(L, "day", !utc ? time.getDate() : time.getUTCDate()); - setfield(L, "month", !utc ? time.getMonth() : time.getUTCMonth()); + setfield(L, "month", (!utc ? time.getMonth() : time.getUTCMonth()) + 1); setfield(L, "year", !utc ? time.getFullYear() : time.getUTCFullYear()); setfield(L, "wday", !utc ? time.getDay() : time.getUTCDay()); let now = new Date(); -- cgit v1.2.3-70-g09d2