[rt-users] TicketSQL Date parse weird..

Stuart Browne stuart.browne at ausregistry.com.au
Thu Jun 7 03:51:28 EDT 2012


> -----Original Message-----
> From: rt-users-bounces at lists.bestpractical.com [mailto:rt-users-
> bounces at lists.bestpractical.com] On Behalf Of Kevin Falcone
> Sent: Thursday, 7 June 2012 1:00 PM
> To: rt-users at lists.bestpractical.com
> Subject: Re: [rt-users] TicketSQL Date parse weird..
> 
> On Tue, Jun 05, 2012 at 06:06:09PM +1000, Stuart Browne wrote:
> > When doing a TicketSQL search similar to the following:
<snip>
> 
> RT actually passes a number of arguments to parsedate:
> 
> grep can find where it's called (not in SQL.pm)
> 
> $ grep -r Time::ParseDate::parsedate lib/
> lib/RT/Articles.pm:        my $seconds = Time::ParseDate::parsedate(
> $args{$date}, FUZZY => 1, PREFER_PAST => 1 );
> lib/RT/Date.pm:        my $date = Time::ParseDate::parsedate(
> 
> -kevin

Ok, further test (see attached perl routine):

[root at psg-apps tmp]# ./test.pl.txt
current time() output:          1339054410

fixed-date Time::ParseDate:     1339113600
tomorrow 10am Time::ParseDate:  1339113600

fixed-date RT::Date output:     1339149600
tomorrow 10am RT::Date output:  1339200000
timezone according to RT::Date: 36000


Using either 'user' or 'server' as the timezone I get the same result but I'm probably missing something here for the fixed-date (I can accept that the date might be being modified elsewhere I'm yet to find), but the 'tomrorow 10am' shouldn't be a full day off.  So the adding of the timezone offset before Time::ParsEdate::parsedate then removing it again appears to be causing the issue here; pushing today past the end of the day boundary.

I'll try this routine tomorrow morning (before 10am) to see if it shows the right thing, then try to figure out a way to get it to return the same result for the two RT::Date outputs.

Stuart
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.pl.txt
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120607/7c5437f1/attachment.txt>


More information about the rt-users mailing list