[rt-users] Using Local Time for Due Date

Jason Grigsby jason at kavi.com
Tue Mar 23 20:38:37 EST 2004


I noticed that when tickets are created, that the time zone the due 
date is set to GMT instead of local time zone. This is a bit confusing 
because the rest of the interface shows times according to local time. 
I'm running RT 3.08.

The relevant code in Create.html is:

if ($QueueObj->DefaultDueIn) {
     my $default_due = RT::Date->new($session{'CurrentUser'});
     $default_due->SetToNow();
     $default_due->AddDays($QueueObj->DefaultDueIn);
     $ARGS{'Due'} = $default_due->ISO();
}

Looking at Date.pm for

The relevant code in Date.pm states:

sub SetToNow {
         my $self = shift;
         return($self->Set(Format => 'unix', Value => time))
}

I just took a look at 3.0.9, and it appears that this code is still the 
same. The question I have are a couple:

1. How can I modify the code so that it displays local time instead of 
GMT?
    I tried looking at the other areas of Date.pm where it sets local 
time, but I'll admit that Perl isn't my best language.

2. If I display local time and the user sets the due date in local 
time, will RT assume that the due date is GMT when the form is posted?
    Surprisingly, I think the answer here is no. I think RT is expecting 
local time instead of GMT, but I'm having trouble tracking down the 
relevant code.

Thank You,

Jason




More information about the rt-users mailing list