Fetch objects published between two dates

Author Message

Eirik Alfstad Johansen

Friday 02 November 2007 2:24:10 am

Hi,

I'm trying to (3.9.1) fetch a list of objects published between two specific dates. My attribute filter looks like this:

array( 'and', array( 'published', '>=', [start_timestamp]), 
		array( 'published', '<=', [end_timestamp]))

However, this doesn't give me any nodes. When I try to replace the "and" with an "or", I get all the objects instead.

What am I doing wrong?

Thanks in advance !

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Julien Plesniak

Tuesday 06 November 2007 7:21:15 am

Hello,

try with this example:

{def $datej = currentdate()}

and

'attribute_filter', array(array(186,'<',$datej),array(187,'>',$datej))

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 19:04:10
Script start
Timing: Jan 18 2025 19:04:10
Module start 'layout'
Timing: Jan 18 2025 19:04:10
Module start 'content'
Timing: Jan 18 2025 19:04:10
Module end 'content'
Timing: Jan 18 2025 19:04:10
Script end

Main resources:

Total runtime0.0227 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0093 588.0469152.6406
Module start 'layout' 0.00930.0041 740.687539.4766
Module start 'content' 0.01340.0065 780.164189.3984
Module end 'content' 0.01990.0028 869.562530.3047
Script end 0.0227  899.8672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002812.3087140.0002
Check MTime0.00135.9317140.0001
Mysql Total
Database connection0.00166.914710.0016
Mysqli_queries0.004921.630730.0016
Looping result0.00000.114210.0000
Template Total0.00209.010.0020
Template load0.00114.839710.0011
Template processing0.00094.114410.0009
Override
Cache load0.00083.590410.0008
General
dbfile0.00166.953580.0002
String conversion0.00000.056640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs