Query by age

Is there a way to use relative times in a search, i.e., “Last Updated
before 13 hours ago”

I know this doesn’t work, I tried it, but it would be useful to be able
to bookmark a query that showed all tickets that were stale.

Chris Mason
masonc@masonc.com
Box 340, The Valley, Anguilla, British West Indies
Tel: 264 497 5670 Fax: 264 497 8463 Cell: 264 235 5670
http://www.anguillaguide.com/ The Anguilla Guide
Talk to me in real time:
Yahoo:netconcepts_anguilla
US Fax and Voicemail: (815)301-9759

Chris Mason wrote:

Is there a way to use relative times in a search, i.e., “Last Updated
before 13 hours ago”

I know this doesn’t work, I tried it, but it would be useful to be able
to bookmark a query that showed all tickets that were stale.

Dates in the search criteria are parsed using Date::Parse, which
does not understand relative times.

This would, however, be a useful thing. Anyone know of a module
which does Date::Parse type stuff but accepts relative times as
well? I don’t see anything obvious on CPAN…
Phil Homewood, Systems Janitor, www.SnapGear.com
pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances

At 10:18 AM 19/12/2002 +1000, Phil Homewood wrote:

Chris Mason wrote:

Is there a way to use relative times in a search, i.e., “Last Updated
before 13 hours ago”

I know this doesn’t work, I tried it, but it would be useful to be able
to bookmark a query that showed all tickets that were stale.

This would, however, be a useful thing. Anyone know of a module
which does Date::Parse type stuff but accepts relative times as
well? I don’t see anything obvious on CPAN…

Chris + Phil,
Time::ParseDate should do the trick.

http://search.cpan.org/author/MUIR/Time-modules-2002.1001/lib/Time/ParseDate.pm

-Brook

= /// /// /// /// _/ _/ Brook Schofield =
= _/ _/ _/ _/ _/ _/ _/ _/ _/ / B.Schofield@mailbox.gu.edu.au =
= // //
/ _/ _/ _/ _/ // Ph: +61 7 387 53779 - WCN 0.28 =
= _/ _/ _/ _/ _/ _/ _/ _/ _/ / Directory Services Integration =
= //
/ / / /// /// _/ _/ Griffith University QLD 4111 =

Brook Schofield wrote:

    Time::ParseDate should do the trick.

Yum. That looks pretty good.

http://search.cpan.org/author/MUIR/Time-modules-2002.1001/lib/Time/ParseDate.pm

… which doesn’t show up in the

Data Type Utilities >> Time
Data Type Utilities >> Date

CPAN listings. Yay CPAN. Thanks Brook. :slight_smile:
Phil Homewood, Systems Janitor, www.SnapGear.com
pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances

It’s also worth having a look at Simon Cozens "Date::PeriodParser"On Thu, Dec 19, 2002 at 10:37:12AM +1000, Phil Homewood wrote:

Brook Schofield wrote:

    Time::ParseDate should do the trick.

Yum. That looks pretty good.

»|« http://www.bestpractical.com/rt – Trouble Ticketing. Free.

Jesse Vincent wrote:

It’s also worth having a look at Simon Cozens “Date::PeriodParser”

Looked at it but it didn’t seem to be such a clean drop-in
replacement. Time::ParseDate does. Working on it now.
Phil Homewood, Systems Janitor, www.SnapGear.com
pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances

Phil Homewood wrote:

Looked at it but it didn’t seem to be such a clean drop-in
replacement. Time::ParseDate does. Working on it now.

Following trivial patch makes RT::Date use Time::ParseDate.
The args to Time::ParseDate::parsedate should probably be
pulled out into config.pm variables, but aside from that,
it seems to work just fine here.
Phil Homewood, Systems Janitor, www.SnapGear.com
pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances

time-parsedate-patch (4.31 KB)