question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

may i know is the feature to convert date to UTC before saving to mysql is removed since 0.1.18. It was working fine in 0.1.17. I tried all subsequent version from 0.1.18 onward and none of it is working.

See original GitHub issue

may i know is the feature to convert date to UTC before saving to mysql is removed since 0.1.18. It was working fine in 0.1.17. I tried all subsequent version from 0.1.18 onward and none of it is working.

Issue type:

[✔] question [ ✔] bug report [ ] feature request [ ] documentation issue

Database system/driver:

[ ] cordova [ ] mongodb [ ] mssql [✔ ] mysql / mariadb [ ] oracle [ ] postgres [ ] sqlite [ ] sqljs [ ] react-native

TypeORM version:

[ ] latest [ ] @next [ ✔] 0.1.17 (or put your version here)

link to reference issue #976

Steps to reproduce or a small repository showing the problem:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:43 (22 by maintainers)

github_iconTop GitHub Comments

10reactions
comettacommented, May 3, 2018

i did many round of tests. Below is the minimum changes that required to get it work on 0.1.19 onward process.env.TZ=UTC verified it saves in mysql as UTC and retrieve as UTC perfectly. No need to add tyeporm option timezone.

9reactions
chriskalmarcommented, May 3, 2018

great, I’m glad it finally works for you. 🎉 to sum it up for others that might have the same issue there are 2 solutions based on the underlying mysql driver in use:

1) with mysql:

set timezone option in typeorm to +0

2) with mysql2:

run the node process with the timezone environment variable TZ=UTC

I think you can close the issue now

Read more comments on GitHub >

github_iconTop Results From Across the Web

MySQL 5.6 Reference Manual :: 12.7 Date and Time Functions
CONVERT_TZ () converts a datetime value dt from the time zone given by from_tz to the time zone given by to_tz and returns...
Read more >
Migrate a MySQL database in a non-UTC time zone using ...
When you use MySQL as a source, the timestamp data isn't migrated properly if your source MySQL instance uses a non-UTC time zone....
Read more >
The LPIC-2 Exam Prep - GitHub Pages
Audience: this book is intended to help people prepare for the LPIC-2 exam. You will need to have at least 2 years of...
Read more >
Untitled
backport upstream changes for geanygendoc to work with CTPL 0.3 - require and ... upstream release: Geany-Plugins 0.20 - remove unnecessary patches since...
Read more >
How to Convert UTC Date To Local time Zone in MySql Select ...
Looks like your mysql timezone table is empty. You have to run mysql_tzinfo_to_sql command for CONVERT_TZ() to work correctly. – ursuleacv. Jun 6,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found