Skip to content

Commit ae8b498

Browse files
committed
Fix getCoercionFunction
1 parent a4b7b03 commit ae8b498

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/adapters/mssql.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,15 @@ module.exports = function () {
304304
)
305305
}
306306

307-
adapter.getCoercionFunction = function (type) {
307+
adapter.getCoercionFunction = function (type, timezone) {
308308
switch (type) {
309309
case 'datetime':
310310
return function (value) {
311311
if (typeof value === 'string') {
312-
return new Date(value.slice(0, 23) + 'Z')
312+
if (timezone !== 'ignore' && !value.includes('Z')) {
313+
value += 'Z'
314+
}
315+
return new Date(value)
313316
}
314317
return value
315318
}

0 commit comments

Comments
 (0)