How to get time zone offset in MySQL?
Hello everyone. I recently needed the time zone offset while working on a project. I could have calculated the time zone offset in PHP, but I thought it would be easier and more advantageous to find it in MySQL. So I created a query that calculates the time zone offset and will share it with you. SELECT TIME_FORMAT(TIMEDIFF(NOW(), CONVERT_TZ(NOW(), 'Asia/Kathmandu', 'UTC')), '%H:%i') as offset; The result will be: '05:45′