Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions drizzle-orm/src/pg-core/columns/timestamp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ export class PgTimestamp<T extends ColumnBaseConfig<'object date'>> extends PgCo
}

override mapFromDriverValue = (value: string): Date | null => {
// Enhanced timezone validation with regex to detect timezone indicators
const hasTimezone = /[+-]\d{2}:?\d{2}$|Z$/.test(value);

if (this.withTimezone && !hasTimezone) {
// Assume UTC if no timezone specified (fixes AWS Data API case)
return new Date(value + 'Z');
}

return new Date(this.withTimezone ? value : value + '+0000');
};

Expand Down