sequelize / sequelize/sequelize

timezone error

Open
#16,681 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

pending-approval
Dominant language
TypeScript
Stars
30.4k
Forks
4.3k
Avg merge
1d 6h
Merged PRs (30d)
68

Description

Issue Creation Checklist

  • I understand that my issue will be automatically closed if I don't fill in the requested information
  • I have read the contribution guidelines

Bug Description

Reproducible Example
import { SequelizeModule } from '@nestjs/sequelize';
...
SequelizeModule.forRoot({
      timezone: "+08:00"
    })

I set some datas to database, and this frame will auto write 'createAt' to database.
The data 'createAt' set to database is in correct timezone
But when I use

import { Model } from 'sequelize-typescript';
...
const {createAt } = await model.findOne({
      where: {
        id,
      },

The 'creatat' time zone is still initial

What do you expect to happen?

The findOne or other's methods can find right timezone in 'createAt'

What is actually happening?

The 'createAt' timezone is still inital

Environment
  • Sequelize version:
  • Node.js version:
  • If TypeScript related: TypeScript version:
  • Database & Version:
  • Connector library & Version:

Would you be willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time and I know how to start.
  • Yes, I have the time but I will need guidance.
  • No, I don't have the time, but my company or I are supporting Sequelize through donations on OpenCollective.
  • No, I don't have the time, and I understand that I will need to wait until someone from the community or maintainers is interested in resolving my issue.

Indicate your interest in the resolution of this issue by adding the 👍 reaction. Comments such as "+1" will be removed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the shown SequelizeModule timezone configuration and model.findOne call, then gather the missing Sequelize, Node.js, database, and connector versions. Compare the stored and retrieved createAt values; the issue is done when the retrieved timestamp uses the intended timezone.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.