tags:

views:

26

answers:

2

I'm playing with timezones in MySQL.

I need to assign people to timezones, and so I looked in mysql.time_zone_data.

Australia seems to have 5 independent timezones [1], so why does mysql.time_zone_data have 23 options?

Australia/ACT
Australia/Adelaide
Australia/Brisbane
Australia/Broken_Hill
Australia/Canberra
Australia/Currie
Australia/Darwin
Australia/Eucla
Australia/Hobart
Australia/LHI
Australia/Lindeman
Australia/Lord_Howe
Australia/Melbourne
Australia/NSW
Australia/North
Australia/Perth
Australia/Queensland
Australia/South
Australia/Sydney
Australia/Tasmania
Australia/Victoria
Australia/West
Australia/Yancowinna

[1] http://www.timetemperature.com/australia/australia_time_zones.shtml

+2  A: 

The same reason, why there are several options in your OS, ...

Not everyone knows in which timezone his town is. So there are some huge cities (which are in the same zone) for selection. So you can look for a city near your location and automatically select the correct timezone.

For example: Berlin and Munich are in the same zone as well as Canberra and Sydney

Erik
Ok, that makes sense.
aidan
+1  A: 

why does mysql.time_zone_data have 23 options?

Usually because each of those mini-regions has historically had different time rules. They may be using the same timezones now, but if you want to reliably convert a time that might be in the past, you'll need to know which exact set of rules the locale has not just now, but for as far back in history as timezones have been stably legislated.

This is what makes timezone databases so absurdly large. Timezones are a horror.

bobince
For Berlin and Munich I'm sure, that they never were in different time-zones. But perhaps there can be found examples like this too.
Erik
FWIW there aren't separate regions for Berlin and Munich in Olson (and hence on the MySQL or OS I have here) or on Windows. Australia is a more complicated case as it's much more fragmented. Sydney and Canberra have always shared timezone rules, but there are parts of New South Wales that haven't, so it's not possible to combine them into one NSW timezone. I guess they are multiple timezones to avoid having to call it “most of NSW except for the weird exceptions”.
bobince