Is there a way in MySQL to calculate the offset for any timezone? For example, to get the local time in the timezone Asia/calcutta. What I want to do is calcula
Asia/calcutta
SELECT TIMESTAMPDIFF(HOUR, UTC_TIMESTAMP(), NOW());
If the server's timezone is PST this will return -8.
-8
SELECT TIMESTAMPDIFF(SECOND, NOW(), UTC_TIMESTAMP());
Add the result of the above to any unix timestamp if you want to compare it to MySQL DateTimes.