Question on usage of timezone in options
See original GitHub issueWhat you are doing?
Let’s say we specify timezone as such:
var sequelize = new Sequelize({
// ...
timezone: "+08:00"
});
What do you expect to happen?
Assuming I have a column with Type: Sequelize.DATE
When I insert 2010-01-01 09:00
for that column, Sequelize stores 2010-01-01 09:00
into the database without converting the value to UTC timezone which is correct.
However, when I query for that same column, Sequelize then returns me 2010-01-01T09:00Z
, with a Z at the back.
What is actually happening?
Shouldn’t the results be 2010-01-01T09:00+08:00
instead of 2010-01-01T09:00Z
since the date is not in UTC timezone?
Dialect: mssql Database version: MSSQL 2014 Sequelize version: 3.0
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Is there a template question to ask respondents their time zone?
I am trying to ask respondents a question: "What time zone will you be based in, at least for the fall semester (September-December)?"....
Read more >Working with Time Zones - W3C
A time zone is a set of rules for determining the local observed time (wall time) as it relates to incremental time (as...
Read more >Why are there multiple timezone choices that all resolve to EST?
So, what one could conclude from this is that a timezone for a particular City is based on its zone boundaries, its daylight...
Read more >Using time zone settings | Looker - Google Cloud
The Application Time Zone is the default time zone for content deliveries. The time zone used for content deliveries does not affect time-based ......
Read more >Time zones - Django documentation
How can I obtain the local time in the current time zone? Well, the first question is, do you really need to? You...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Since the datatypes are different, if we change it on v3, sequelize models will use
DATETIMEOFFSET
but the database hasDATETIME2
datatype. You would need to convert the existing datetime2 to datetimeoffset. If you create new tables without datatype change, you’ll have some in old datatype and some in new. Hence it’s a BC. You can submit a PR to v3 and add a note in change log under BC section.@harshithkashyap Do you mind elaborating on why is this a breaking change? I was comparing the files in master and v3 in this case, and I think v3 can be modified the same way.
I can submit a PR to v3, just that I am curious on why is this counted as a breaking change.
Are you referring to this - #7419?
Thanks