View Issue Details

IDProjectCategoryView StatusLast Update
0016919phpList 3 applicationCampaign Managementpublic22-11-18 17:50
Reporterlwc Assigned To 
Status resolvedResolutionfixed 
Product Version3.0.5 
Target VersionFuture developments 
Summary0016919: Configurable timezone offset
DescriptionAs mentioned in #5331 and in several forum topics, it's time for an official request to allow configuring a timezone.
Additional Information
TagsNo tags attached.



15-10-13 10:59

administrator   ~0052353

check out the "config_extended.php" :

# Time Zone
# By default phpList will operate in the Timezone of your server. If you want to work
# in a different Timezone, you can set that here. It will need to be a valid setting for
# both PHP and Mysql. The value should be a city in the world
# to find PHP timezones, check out
# You will also need to tell Mysql about your timezones, which means you have to load the timezone
# data in the Mysql Database, which you can find out about here:
# make sure that the value you use works for both PHP and Mysql. If you find strange discrepancies
# in the dates and times used in phpList, you probably used the wrong value.

# define('SYSTEM_TIMEZONE','Europe/London');

although, some feedback on this may be useful


15-10-13 17:02

updater   ~0052354

Last edited: 15-10-13 17:06

View 4 revisions

Wasn't aware of this v3 setting, I take my hat off for you!
But I see some problems with this approach:
1) Not everyone have the needed permissions for the MySQL change.
2) It won't just affect phpList but other tables as well, if such exist.
3) It's a very specific hack for MySQL. It won't work with other databases.
4) If you have MySQL, but for some reason would ever need to replace timezones, it would create a major headache because you already saved them in the previously local timezone.

But I'll tell you what, I also have a solution, which I will supply in the following note.


15-10-13 17:03

updater   ~0052355

Last edited: 15-10-13 17:07

View 3 revisions

I have an idea for a solution that will let PHP do all the work and thus be database independent and let you change timezones on the fly:
1) Assign a PHP timezone in the main script.
2) When you save times into the database, store the times in UTC/GMT+0.
3) When you restore times from the database, transition them into local times.

In other words:

// Main script

if (defined('SYSTEM_TIMEZONE'))
    ini_set('date.timezone', SYSTEM_TIMEZONE);

// Store the resulting time into the database
function time_for_database($time='') {
  if (empty($time))
    $time = time();
  if (defined('SYSTEM_TIMEZONE'))
     $time -= (int)substr(date('O'),0,3)*60*60;
  return $time;

// When reading a time from the database
function time_from_database($database_time) {
  if (defined('SYSTEM_TIMEZONE'))
      $database_time += (int)substr(date('O'),0,3)*60*60;
  return $database_time;


16-10-13 02:12

administrator   ~0052358

yes, that's another option. Except it will require quite a lot more changes in the code, and is therefore more likely to start causing bugs (or often called undocumented features :-)

Still it can be good to look into it. For the time being timezone settings are for powerusers only.


31-03-15 09:53

manager   ~0055998

where are we at with this? Just documenting scheduling and want to know what to say.... I know we have the feature in hosted, has that changed the situation for download at all?


02-04-15 12:59

administrator   ~0056001

you can use


22-11-18 17:50

manager   ~0061431

@xheni this has been raised again by @lwc. Any thoughts on the various options here?