Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New Zealand timezone conversion in MySQL

I'm probably being really stupid / blind, but I can't find any timezones relevant to New Zealand in MySQL.

I'm using TZ_CONVERT function, and it accepts timezone specified in a number of different formats.

E.G. BST (British Summer Time) and GMT (Greenwich Mean Time) are both used by the UK at different times of the year due to daylight savings. So, I'm using "Europe/London", because that automatically adjusts for daylight savings.

I now need to convert into New Zealand time, and I want to use this Continent/City format rather than the BST, MET, EST, etc. format.

Unfortunately I can't find any in this format that are relevant to NZ.

I'm looking at the list in mysql.time_zone_name

like image 210
aidan Avatar asked Jun 14 '11 15:06

aidan


1 Answers

I suspect you want "Pacific/Auckland" as the time zone name. There's also "Pacific/Chatham" for the Chatham Islands.

I'll admit it's not always easy to work out which zoneinfo name is the most appropriate one...

like image 148
Jon Skeet Avatar answered Sep 26 '22 00:09

Jon Skeet