New Zealand timezone conversion in MySQL
I'm probably being really st开发者_运维技巧upid / 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
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...
You could write a small script that check for the location and if it returns New Zealand then + or - the amount of hours in relation to the GMT
i will have a little research for you
精彩评论