Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

406
Visualizações
Sequelize model date output format cannot remove UTC after set up timezone

On my Sequelize setting, I'm using SQL Server and I have set up timezone and dialectOptions:

dialect: "mssql",
dialectOptions: {
        useUTC: false,
        dateStrings: true,
        typeCast: true,
},
timezone: "Australia/Sydney"

I also have a code to convert the date format:

const DataTypes = require("sequelize/lib/data-types")

DataTypes.DATE.prototype._stringify = function _stringify(date, options) {
    date = this._applyTimezone(date, options)
    return date.format("YYYY-MM-DD HH:mm:ss.SSS")
}

The date record saving into database is the Sydney time. This is what I want. However, when retriving out the record, the output is always load as a UTC time even though actually it's a Sydney time. For example, what I saved in the database is 2021-10-20 00:56:59 and what I output from model is 2021-10-20T00:56:59.277Z. What I know the "Z" at the end stands for the Zero timezone, so it's a UTC time. How can I make the output display without "Z" so the system can know it's not a UTC time?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda