<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16587" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=140074121-08022008><FONT face=Arial size=2>As has been
mentioned I am working on trying to get a time worked scrip up and running. So
far everything is going well except for one thing, I can retrieve dates from the
ticket without problem and they come through like:</FONT></SPAN></DIV>
<DIV><SPAN class=140074121-08022008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=140074121-08022008><FONT face=Arial size=2>2008-02-08
21:24:49</FONT></SPAN></DIV>
<DIV><SPAN class=140074121-08022008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=140074121-08022008><FONT face=Arial size=2>This seems like a
fine format, but once I have 2 of them, I can't figure out how to calculate the
difference. It was suggest that I might need to convert them to unix time and
back, but I am not sure how to do that. I see that Time::Local
could possibly be used or maybe Date::Manip but my admittedly novice Perl
skills don't particularly help me out here.</FONT></SPAN></DIV>
<DIV><SPAN class=140074121-08022008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=140074121-08022008><FONT face=Arial size=2>Here is the scrip as
it sits, and after using RT::Logger->debug it appears that all I need is
to get the date difference calculation to work</FONT></SPAN></DIV>
<DIV><SPAN class=140074121-08022008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=140074121-08022008><FONT face=Arial size=2>if
($self->TicketObj->Type eq "Correspond" || $self->TicketObj->Type eq
"Comment" || $self->TicketObj->Type eq "ticket") <BR>{</FONT></SPAN></DIV>
<DIV><SPAN class=140074121-08022008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=140074121-08022008><FONT face=Arial size=2>#This is the part
that is not working.</FONT></SPAN></DIV>
<DIV><SPAN class=140074121-08022008><FONT face=Arial size=2>my $ticket_Worked =
($self->TicketObj->LastUpdated -
$self->TicketObj->Created);</FONT></DIV>
<DIV><SPAN class=140074121-08022008><FONT face=Arial size=2>#End part that is
not working</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>$self->TicketObj->SetTimeWorked($ticket_Worked);</FONT></DIV>
<DIV><FONT face=Arial size=2>} else {</FONT></DIV>
<DIV><FONT face=Arial size=2> return undef;<BR>}</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=140074121-08022008>The other thing that
I thought was weird when I looked in my rt.log was that when I would comment on
the ticket, the returned result of the if test that I start with was "ticket"
which seems strange to me, but what do I know. Maybe someone could explain that
to me as well?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV align=left><FONT face=Arial size=2><STRONG>Greg Evans</STRONG></FONT></DIV>
<DIV align=left><FONT face=Arial color=#374564 size=2>Internet
Support</FONT></DIV>
<DIV align=left><FONT face=Arial color=#374564 size=2>Hood Canal
Communications</FONT></DIV>
<DIV align=left><FONT size=2><FONT face=Arial><FONT color=#374564>(360) 898-2481
ext.212</FONT> </FONT></FONT></DIV>
<DIV> </DIV></BODY></HTML>