[rt-users] Buggy Date searching - GMT mishap?
Ben Goodwin
ben at atomicmatrix.net
Tue Jan 13 16:45:40 EST 2004
Here's a code core snippet and the results. Check out the resulting SQL query! I'm still digging to find the source of this problem. I'm not sure but I think this started after I upgraded from 3.0.6 to 3.0.8 as I've never seen my reminder script behave the way it has until after that point.
my $tickets = new RT::Tickets($RT::SystemUser);
my $timeDelta = new RT::Date($RT::SystemUser);
my $maxAge = 30;
$timeDelta->SetToNow();
print $timeDelta->ISO . "\n";
$timeDelta->AddSeconds($maxAge * 60 * -1);
print $timeDelta->ISO . "\n";
$tickets->LimitCreated(OPERATOR => '>', VALUE => $timeDelta->ISO);
$tickets->DEBUG(1);
my $tix;
while (my $Ticket = $tickets->Next) {
print $Ticket->id . "\n";
}
[pts/0:cvs] [/var/tmp] > date
Tue Jan 13 16:39:33 EST 2004
[pts/0:cvs] [/var/tmp] > sudo ./nag
2004-01-13 21:39:40
2004-01-13 21:09:40
RT::Tickets=HASH(0x8b653f0)->_GenericRestriction QualifiedField=main.Created
RT::Tickets=HASH(0x8b653f0)->_GenericRestriction QualifiedField=main.EffectiveId
RT::Tickets=HASH(0x8b653f0)->_GenericRestriction QualifiedField=main.Type
DBIx::SearchBuilder->DoSearch Query: SELECT main.* FROM Tickets main WHERE ((main.EffectiveId = main.id)) AND ((main.Type = 'ticket')) AND ( ( (main.Created > '2004-01-14 02:09') ) )
-=| Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20040113/7f746ac1/attachment.htm>
More information about the rt-users
mailing list