Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

397
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!