Muhammad Muaaz
Muhammad Muaaz

Reputation: 304

MySQL server stuck when use CONVERT_TZ

I have a table of Doctor like:

-----------------------------
| id |       open_at        |
-----------------------------
| 1  | 2020-03-13 10:50:03  |
| 2  | 2020-03-21 23:15:15  |
| 3  | 2020-04-11 14:23:11  |
-----------------------------
And more values like this

I apply this query which obviously works fine.

SELECT id, open_at FROM mydb.doctor;

However, when I apply CONVERT_TZ, the server hangs. This is how the query looks.

SELECT id, CONVERT_TZ(open_at, 'GMT', 'EST') AS 'open_time'
FROM mydb.doctor;

With this query, the server hangs, and the query keeps processing even for an hour.

Upvotes: 0

Views: 176

Answers (1)

Starnec
Starnec

Reputation: 587

You should use UTC rather than GMT u can check this link for more information convert GMT time to EST.Hoping it will help.

Upvotes: 0

Related Questions