Entries by

My Adventure of Making a Snake Game with Javascript

Ever since I was a kid, I've always been curious about making games, and I wanted to create my own one day. After spending so much time in the software industry, I asked myself why I shouldn't do it anymore. This way, I'll both improve my Javascript skills and gain a perspective on the software development process in a way I've never seen before. Before I even started coding the game, I started thinking about what the snake's movement algorithm would be like. […]

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′