[Rt-devel] RT 3.6.4rc2

Norton, Ian i.norton at lancaster.ac.uk
Thu Jun 14 12:35:28 EDT 2007


Hi all,

> 	$RT::Timezone should now actually work.
> 
> I'd like to hear a couple success reports and confirmation 
> that we've fixed the regression in rc1 before rolling the 
> final next week.

The timezone fix doesn't appear to be working for a test installation.

The system timezone is set to GMT, with the RT Timezone set to
"US/Eastern".  Recording comments in a ticket shows them logged at the
GMT time rather than the local timezone.  By this we know that the
database is correctly logging them at GMT but that the UI is not
translating them for display.

I *think* that the following sample code should illustrate the problem:

--SNIP--

#!/usr/bin/perl -w

use strict;
use lib "/usr/local/rt3.6.4rc2/lib";
use RT;

# Load config and init
RT::LoadConfig();
RT::Init();

require "RT/Date.pm";

# Create a date object and set it to now
my $date = RT::Date->new(RT::SystemUser);
$date->SetToNow();

# timezone as defined by RT
print("LocalTimezone - " . $date->LocalTimezone() . "\n");

# timezone environment variable
print("TZ Env var    - " . $ENV{TZ} . "\n");

# time AsString (Returns the object's time as a string with the current
timezone)
print("AsString      - " . $date->AsString() . "\n");

# localtime
print("Localtime     - " . localtime() . "\n");

--SNIP--

The results are this:

LocalTimezone - US/Eastern
TZ Env var    - US/Eastern
AsString      - Thu Jun 14 16:14:15 2007
Localtime     - Thu Jun 14 16:14:15 2007

Whilst I expect localtime to return the value it does, AsString returns
the same value.

Assuming this is a valid test which I accept it may not be, are there
any suggestions on how to fix this please?

We're using ubuntu 6.06 with perl 5.8.7 and My SQL 5.0.22.

Thanks, Ian.


More information about the Rt-devel mailing list