1

As you know, Drupal 6 doesn't have the +0430 timezone in the date/time page. I want to add this specific item into timezone drop-down list.

Does anybody know about this core patching? How can I do it?

0

I think this looks like a problem in PHP. The timezone is being used by the Date module, and that contains date_timezone_abbr(), which uses PHP's timezone_abbreviations_list().

Only the keys are stored, and the PHP function is being used. I am afraid there is no way out of this, unless there is a way to convince PHP.

When I tried the following code, I get 4, not 4.5.

$a = timezone_abbreviations_list();
echo $a['aft'][0]['offset'] / 3600;
  • Nobody Has a an answer for my question ? :( – Mehrdad201 Apr 20 '12 at 9:36
  • try this if you can change your system stackoverflow.com/questions/5776392/… – mojzis Apr 20 '12 at 10:48
  • I visited it. Unfortunately I am not pro in PHP programming. I am searching a way to modify timezone list in DRUPAL 6. – Mehrdad201 Apr 20 '12 at 18:03
0

I found the solution for my question.

Go to modules > systems

open system.module

Then find _system_zonelist function

/**
 * Generate an array of time zones and their local time&date.
 */
function _system_zonelist() {
  $timestamp = time();
  $zonelist = array(-11, -10, -9.5, -9, -8, -7, -6, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1, 0, 1, 2, 3, 3.5, 4, 5, 5.5, 5.75, 6, 6.5, 7, 8, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 14);
  $zones = array();
  foreach ($zonelist as $offset) {
    $zone = $offset * 3600;
    $zones[$zone] = format_date($timestamp, 'custom', variable_get('date_format_long', 'l, F j, Y - H:i') .' O', $zone);
  }
  return $zones;
}

All you need is adding 4.5 value to $zonelist array.

The array must be

$zonelist = array(-11, -10, -9.5, -9, -8, -7, -6, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1, 0, 1, 2, 3, 3.5, 4,4.5, 5, 5.5, 5.75, 6, 6.5, 7, 8, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 14);
  • Plus, file an issue to drupal core project so that they add the time zone and free people from hacking the core :) – Artur Jul 9 '12 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.