Improve Timezone Support for Existing MySQL Databases configured with a Non-UTC Timezone
<!-- Thanks for helping us improve Prisma! π Please follow the sections in the template and provide as much information as possible about your problem, e.g. by setting the `DEBUG="*"` environment variable and enabling additional logging output in Prisma Client. Learn more about writing proper bug reports here: https://pris.ly/d/bug-reports --> ## Bug description <!-- A clear and concise description of what the bug is. --> The OS and MySQL time both are set to KST(Korea Standard Time) which is UTC+9:00. But when create or update records with `new Date()`, `DATETIME` string doesn't respect the database's timezone and always filled with UTC time. For example, when the current time is `2020-06-20 13:00:00` in **Korea**, I expect the data should be stored like below id | created_at :--:|:--: 1 | 2020-06-20 13:00:00 However, what I get is UTC time which differs -9 hours. id | created_at :--:|:--: 1 | 2020-06-20 04:00:00 ## How to reproduce <!-- Steps to reproduce the behavior: 1. Go to '...' 2. Change '....' 3. Run '....' 4. See error --> 1. Set the system and MySQL timezone to `Asia/Seoul` or `UTC+9:00` 2. Create with `new Date()` ```ts await prisma.myTable.create({ data: { createdAt: new Date() } }) ``` ## Expected behavior <!-- A clear and concise description of what you expected to happen. --> I expect the `DATETIME` string to be synced with MySQL's timezone. ## Prisma information <!-- Your Prisma schema, Prisma Client queries, ... Do not include you
Posted by jhaemin on Jun 20, 2020, 11:13 AM
Tags
Related issues
- some bike vendor told me that the biggest problem with regular to ebike conversion was that regular bike frames were not strong enough to...
- I think of this as the kiosk economy.
- What a goofy comment.
- There's lots of evidence for positive influences of Caffeine on the body (some negative as well), especially the brain.
- Compose support in WSLc
- [RFC] Roadmap to v2.0
Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments
support (Other)
some bike vendor told me that the biggest problem with regular to ebike conversion was that regular bike frames were not strong enough to...
I think of this as the kiosk economy.
What a goofy comment.
There's lots of evidence for positive influences of Caffeine on the body (some negative as well), especially the brain.
Compose support in WSLc
[RFC] Roadmap to v2.0
[Feature]: Add TurboQuant Support for KV Cache Quantization
Support for AGENTS.md and .agents/skills/, the community has been asking since August 2025
Improve Timezone Support for Existing MySQL Databases configured with a Non-UTC Timezone
<!-- Thanks for helping us improve Prisma! π Please follow the sections in the template and provide as much information as possible about your problem, e.g. by setting the `DEBUG="*"` environment variable and enabling additional logging output in Prisma Client. Learn more about writing proper bug reports here: https://pris.ly/d/bug-reports --> ## Bug description <!-- A clear and concise description of what the bug is. --> The OS and MySQL time both are set to KST(Korea Standard Time) which is UTC+9:00. But when create or update records with `new Date()`, `DATETIME` string doesn't respect the database's timezone and always filled with UTC time. For example, when the current time is `2020-06-20 13:00:00` in **Korea**, I expect the data should be stored like below id | created_at :--:|:--: 1 | 2020-06-20 13:00:00 However, what I get is UTC time which differs -9 hours. id | created_at :--:|:--: 1 | 2020-06-20 04:00:00 ## How to reproduce <!-- Steps to reproduce the behavior: 1. Go to '...' 2. Change '....' 3. Run '....' 4. See error --> 1. Set the system and MySQL timezone to `Asia/Seoul` or `UTC+9:00` 2. Create with `new Date()` ```ts await prisma.myTable.create({ data: { createdAt: new Date() } }) ``` ## Expected behavior <!-- A clear and concise description of what you expected to happen. --> I expect the `DATETIME` string to be synced with MySQL's timezone. ## Prisma information <!-- Your Prisma schema, Prisma Client queries, ... Do not include you
Comments (0)
No comments yet. Start the discussion.