joomla unknown or bad timezone (-5)

Written by Peter Davies on .

Discovered the following cryptic message on a clients Joomla. Key facts were that the site was upgraded from a v1.5x to a version 3.x and the subscription and users had to be migrated.

From a few searches on the web it highlighted the likely cause to be the user parameters, each with their own language and timezone offset properties. It was also apparent that the structure of the parameter field had changed between versions, one being newline separated and the newer being JSON based:

OLD:

admin_language=en-GB
language=en-US
editor=
helpsite=
timezone=-5

NEW:

{"admin_style":"","admin_language":"","language":"","editor":"none","helpsite":"","timezone":"Europe\/London"}

The fastest solution was to reset all of the users parameters where timezone was set:

update `jos_users` SET params = null WHERE `params` LIKE ('%timezone%')

Resulting in the following:

12 rows affected. ( Query took 0.0064 sec )