This patch allows visitors to your site to choose their time zone. Times listed on RecentChanges and other category pages will appear in their time zone, rather than the server time zone. In addition, you can choose a default time zone for users who haven't set the option.
Choose your current time here, so the server may figure out what time zone
you are in.<br /><br />
<select name="tzoff">
<?php
for($i = -23.5 * 60; $i <= 23.5 * 60; $i += 30)
{
?>
<option value="<?php print $i; ?>"<?php if($i == $TimeZoneOff) { print ' selected="selected"'; } ?>><?php
print date('Y-m-d H:i', time() + $i * 60);
?></option>
<?php
}
?>
</select><br /><br />
if(ereg("tzoff=([[:digit:]]+)", $prefstr, $result))
{ $TimeZoneOff = $result[1]; }
// Default time zone offset (in minutes) for visitors who haven't yet set their // preferences. $TimeZoneOff = 0;
function html_time($timestamp)
{
global $TimeZoneOff;
if($timestamp == '') { return 'never'; }
$time = mktime(substr($timestamp, 8, 2), substr($timestamp, 10, 2),
substr($timestamp, 12, 2), substr($timestamp, 4, 2),
substr($timestamp, 6, 2), substr($timestamp, 0, 4));
return date('D, d M Y H:i:s', $time + $TimeZoneOff * 60);
}
function html_timestamp($timestamp)
{
global $TimeZoneOff;
$time = mktime(substr($timestamp, 8, 2), substr($timestamp, 10, 2),
substr($timestamp, 12, 2), substr($timestamp, 4, 2),
substr($timestamp, 6, 2), substr($timestamp, 0, 4));
return date('Y.m.d H:i:s', $time + $TimeZoneOff * 60);
}
if(strcmp($tzoff, "") != 0)
{ $value = $value . "&tzoff=$tzoff"; }