I was wonder what is the maximum length of the timezone settings in PHP? I’m storing the string in a database, and would like to keep the length as short as possible, but i see timezones like “Canada/East-Saskatchewan”, which goes beyond our current limit.
If I could just get a list of all the supported timezone string, I can sort them, but they are currently split on to several different pages.
Edit June 2021 Answer is 64. Why? That’s the width of the column used in MySQL to store those timezone name strings.
The zoneinfo database behind those time zone strings just added new prefixes. To
America/Argentina/ComodRivadavia, formerly the longest timezone string, they addedposix/America/Argentina/ComodRivadaviaandright/America/Argentina/ComodRivadavia, both with a length of 38. This is up from 32, the previous longest string.And here is the complete PHP code to find that: