How to calculate MySQL timezone offset

Sometimes it is necessary to calculate the offset for the current timezone. Therefore you can use this helpful snippet:

Chris / / last updated on
SET @tzOffset = (UNIX_TIMESTAMP()-UNIX_TIMESTAMP(CONVERT_TZ(NOW(), 'Etc/UTC', 'Europe/Berlin')));

That’s it.

Post Comments to "How to calculate MySQL timezone offset"

Submit Comment

With the use of this comment form you agree to the saving and processing of your data by this website. More information about the processing of your data can be found in our privacy statement.
Your data will be transmitted securely via SSL.

Meine Magento Extension Bestseller