[rt-users] Find the first day of this month

Chris Herrmann chrisherrmann7 at gmail.com
Tue Dec 8 05:55:08 EST 2015


Hi all,

This has been kicked around a few times over the years if google & the list
archives are anything to go on, but I haven't actually seen a solution that
meets what any of the requestors (and me) want.

Which is... to run a search using a date like:

Queue = 'myqueue' and (  ( Status = 'open' or Status = 'new' ) OR (
Resolved > 'first dow after last month' ) )


or "last month + 1" or "first dom" or really anything that will
programmatically always return the first day of this month. I have a shell
script that does this by constructing a date in bash, and then passing the
date to the query as a variable, but I can't do this within the "save
search" function.


The reason I'm after "save search" is that the HTML reports are easier for
humans to read than the TSV extracts that the bash scripts generate.


things like "last month" get close - but it simply works out "now - 30
days". And I can't see a way in Time::ParseDate to extract the month and
year in the same way I would in bash using something like `date +%b`


MIT have a nice page that has better examples than the Time::Parse doco
http://kb.mit.edu/confluence/pages/viewpage.action?pageId=4269222  but I
can't work out how to construct the thing I want using what's available.


Please tell me I'm wrong!


Regards,


Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20151208/2c844382/attachment.htm>


More information about the rt-users mailing list