From fee7f198841666448e48260d37d73a0e3c7ca663 Mon Sep 17 00:00:00 2001 From: Roland Teichert Date: Wed, 23 Oct 2024 16:43:01 +0200 Subject: [PATCH] Date adjustments the final frontier --- lib/datetime_decode.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/datetime_decode.js b/lib/datetime_decode.js index 688a8a4..c7bb56e 100644 --- a/lib/datetime_decode.js +++ b/lib/datetime_decode.js @@ -45,7 +45,7 @@ exports.getDate = function ( date ) { if (!useDateStringsForType(dateStrings, 'DATE')) { - return new Date(year, jsMonthFromMysqlMonth(month), date); + return new Date(Date.UTC(year, jsMonthFromMysqlMonth(month), date)); } return getDateString(year, month, date); }; @@ -66,13 +66,7 @@ exports.getDateTime = function ( ) { if (!useDateStringsForType(dateStrings, 'DATETIME')) { return new Date( - year, - jsMonthFromMysqlMonth(month), - date, - hour, - minute, - second, - fraction ? fraction.milliseconds : 0 + Date.UTC(year, jsMonthFromMysqlMonth(month), date, hour, minute, second, fraction ? fraction.milliseconds : 0) ); } return (