Skip to content

Commit 777d874

Browse files
committed
fix(orm): correcting timezone for Date returned in nested queries
1 parent a9ff7e4 commit 777d874

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/orm/src/client/crud/dialects/postgresql.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ export class PostgresCrudDialect<Schema extends SchemaDef> extends BaseCrudDiale
106106

107107
private transformOutputDate(value: unknown) {
108108
if (typeof value === 'string') {
109-
return new Date(value);
109+
// force interpret as UTC
110+
return new Date(value.endsWith('Z') ? value : `${value}Z`);
110111
} else if (value instanceof Date && this.options.fixPostgresTimezone !== false) {
111112
// SPECIAL NOTES:
112113
// node-pg has a terrible quirk that it returns the date value in local timezone

0 commit comments

Comments
 (0)