Drupal 7, Views node to be selected on date range.
I would like to have my view only return nodes that were created last month, no matter when I run the view this month. So as it's the middle of January, I want all nodes created in December last year, and next month I want all of January's
So the dates would be between first day of last month and the last day of last month.
In php I can use:
echo date('Y m d', strtotime('first day of last month'))
echo date('Y m d', strtotime('last day of last month'))
to get the correct date range.
However, in Drupal, the SQL does not create the correct ranges.
Viewing the view and sql logs at 11:55 on Jan 16th 2013 I see :
(node.created >= 1358337264-2678400
which works out as 2012-12-16 11:54:24, so it is a month ago, but not the first day of that month.