[rt-devel] RT::Date GMT vs Local
Ruslan U. Zakirov
cubic at acronis.ru
Sat Mar 27 05:23:59 EST 2004
Jesse Vincent wrote:
>
> On Mar 27, 2004, at 2:27 AM, Ruslan U. Zakirov wrote:
>
>> Now, I want return to 'GMT vs Local' in RT API.
>> Attached show scrip show that API is not coherent enought.
>> Output:
>> DBIx::SearchBuilder->DoSearch Query: SELECT count(main.id) FROM
>> Tickets main WHERE ((main.EffectiveId = main.id)) AND ((main.Status
>> != 'deleted')) AND ((main.Type = 'ticket')) AND ( ( (main.Created >
>> '2004-03-25 14:55') ) )
>> Tickets 294
>> ...
>>
>> DBIx::SearchBuilder->DoSearch Query: SELECT count(main.id) FROM
>> Transactions main WHERE ((main.Created > '2004-03-25 17:55:13'))
>> Transactions 1964
>
>
> I believe this is related to a known bug in 3.0.9. What perl code did
> you use to build those queries?
>
Sorry, attachment missed.
-------------- next part --------------
#!/usr/bin/perl
use lib "/opt/rt3/lib";
use RT;
RT::LoadConfig;
RT::Init;
use RT::Date;
my $d = RT::Date->new( $RT::SystemUser );
$d->SetToNow;
$d->AddDays( -1 );
print $d->ISO . "\n";
print $d->AsString . "\n";
use RT::Tickets;
my $ts = RT::Tickets->new( $RT::SystemUser );
$ts->DEBUG(1);
$ts->Limit( FIELD => 'Created', OPERATOR => '>', VALUE => $d->ISO );
print "Tickets " . $ts->Count ."\n";
use RT::Transactions;
my $txs = RT::Transactions->new( $RT::SystemUser );
$txs->DEBUG(1);
$txs->Limit( FIELD => 'Created', OPERATOR => '>', VALUE => $d->ISO );
print "Transactions " . $txs->Count ."\n";
More information about the Rt-devel
mailing list