0

We currently have a mariab galera cluster with 7 nodes; 3 on local and 4 on Azure cloud. All nodes are using Mariadb 10.5.16 version. My issue is that on my local cluster when I run the following query:

SELECT created_at,updated_at FROM stuffs WHERE ref_num = "XXX123";

My Local Nodes return: (incorrect time)

created_at updated_at
2020-12-18 02:00:19 2020-12-18 02:01:51

While my Azure nodes return: (correct time)

created_at updated_at
2020-12-17 13:00:19 2020-12-17 13:01:51

I checked the date and time on the servers and they return the same. Same with select NOW() and TIMESTAMP().

When the application inserts and fetched the data, it inserts and returns the correct date and time. But when queried from the local nodes it returns a different value.

Will there be any issues with the data itself on the database? Is there any way to fix this mismatch? Thanks

1 Answer 1

1

Is that column a TIMESTAMP? Azure systems are probably set to UTC as their timezone; what timezone are the local nodes?

TIMESTAMP is converted to local time when SELECTing. So, those dates are probably the "same".

DATETIME, on the other hand, can be thought of as a picture of a clock -- no TZ adjustment.

1
  • We have our local on PST, but after checking it seems that our Azure servers use EDT as their timezone. I checked the data type and yes both use TIMESTAMP data.
    – Gwynn
    Commented May 22, 2023 at 6:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.