Time zones are always tricky. Luckily Coordinated Universal Time (UTC) makes it easy to get your local time even if your database is hosted on the other side of the world.
The code below returns the local time in New Zealand.
SELECT CONVERT_TZ( UTC_TIMESTAMP( ) , 'UTC', 'NZ' );
One Thought on “MYSQL – Getting Your Local Time”