[rt-users] TicketSQL Date parse weird..
Kevin Falcone
falcone at bestpractical.com
Wed Jun 6 23:00:01 EDT 2012
On Tue, Jun 05, 2012 at 06:06:09PM +1000, Stuart Browne wrote:
> When doing a TicketSQL search similar to the following:
>
> Status = 'open' AND Due <= '10am tomorrow'
>
> The time portion of the string isn't taken into account.
>
> On the command line, a quick test of Time::DateParse shows it works:
>
> ]# perl -e 'use Time::ParseDate; print parsedate("2012-06-06 10:00") . "\n"; print parsedate("10am tomorrow") . "\n";'
> 1338940800
> 1338940800
>
> So it appears as if RT is parsing the date string of 'Due' and messing with it. Using the time portion before or after, using 10am vs 10:00, none appear to work. Using any time component has the same result (thinking it may be a timezone issue. It wasn't).
>
> I can't see in the RT code where this might be happening (been looking in SQL.pm). Can someone point me in the right direction?
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120606/24f9b1f9/attachment.sig>
More information about the rt-users
mailing list