Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@CreateDateColumn and @UpdateDateColumn does not read back in UTC #176

Closed
ykim opened this issue Jan 6, 2017 · 2 comments
Closed

@CreateDateColumn and @UpdateDateColumn does not read back in UTC #176

ykim opened this issue Jan 6, 2017 · 2 comments
Labels

Comments

@ykim
Copy link

ykim commented Jan 6, 2017

I'm currently using TypeORM 0.0.5, which is persisting into a Postgres 9.6 instance. When I create an entity with CreateDateColumn and UpdateDateColumn, it persists the date as an UTC timestamp correctly. However, when I used findOneById to get the entity, the corresponding fields are being parsed in local time. I have set both storeInLocalTimezone and loadInLocalTimezone to false. Is this supposed to be the expected behavior?

@pleerock
Copy link
Member

pleerock commented Jan 10, 2017

It looks like this is how underlaying drivers work. In mysql there is timezone: "utc" that can be used to make it work correctly. in postgres here is issue, somebody suggest to set machine time to timezone and problem will be resolved

@pleerock
Copy link
Member

I made a fix, it should work now as expected. Released in 0.0.7-alpha.6. Please let me know if something is still wrong there

@pleerock pleerock added the bug label Jan 11, 2017
bbakhrom added a commit that referenced this issue Mar 19, 2019
Kononnable added a commit that referenced this issue Oct 10, 2019
Feature - support richer derivation of column & entity name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants