[rt-users] TimeZone Questions...Again!
Bruce Campbell
bruce_campbell at ripe.net
Thu Dec 19 05:14:51 EST 2002
On Wed, 18 Dec 2002, Michele Hershey wrote:
> In one of our scripts it has been asked to include the CREATION &
> RESOLUTION time.
>
> When a call is resolved and then dead an auto message goes to the
> requestor stating the call is closed and these 2 pertinent dates/times.
>
> The SEARCH is perfect, and no complaints it is displaying in HST.
> It is the dates that come out of SQL that are 10 hours off (GMT). We
> don't deal with daylight savings and would like the dates to be correct
> in the data base also. We read the previous solutions and they are not
> providing this result.
As per the previous solutions, you really, really do not want to change
the timezone that RT stores dates in SQL.
> The Script reads:
>
> Ticket Created: {$Ticket->Created} Ticket Resolved:
> {$Ticket->Resolved}
Try:
{$Ticket->CreatedObj->AsString} and
{$Ticket->ResolvedObj->AsString}
which will return times in the local timezone, assuming that $Timezone in
etc/config.pm has been set to something that your system recognises.
( $Ticket is an RT::Ticket object. $Ticket->CreatedObj is returning an
RT::Date object. The 'AsString' method in this returns times in the
local timezone )
--
Bruce Campbell RIPE
Systems/Network Engineer NCC
www.ripe.net - PGP562C8B1B Operations/Security
More information about the rt-users
mailing list