Skip to content

[BUG]: withTimeZone: true returns incorrect date string #5090

@odicho

Description

@odicho

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

1.0.0-beta.2

What version of drizzle-kit are you using?

1.0.0-beta.2

Other packages

drizzle-arktype@1.0.0-beta.2

Describe the Bug

I have saved a timestamp to the DB, and the value is 2025-12-31 04:17:26.222644+00

timestamp({ mode: "string", withTimezone: true })

When I query the DB to get the value, say my TZ is CST, it returns: 2025-12-31 04:17:26.222644-06

This is incorrect for two reasons:

  1. It should return the UTC value exactly as-is.
  2. The conversion is wrong anyways, it just changes the offset and keeps the date/time the exact same.

I am using drizzle-orm/bun-sql

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions