Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

399
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda