get all nodes created in a specific month I have a custom search form that I posts a year + month, such as
2014-04
I would like to get all nodes created that month, when I create the timestmap I use:
"SELECT .......         AND changed >= 'strtotime($date)'"

This is the code for form date:

$form['aqar_date'] = array(
'#type' =&gt; 'date_select', 
'#title' =&gt; t('Date'),
'#prefix' =&gt; '&lt;div id="space_replace" class="search-title-date"&gt;   &lt;h2&gt;Node date&lt;/h2&gt;',
'#suffix' =&gt; '&lt;/div&gt;',     
'#date_format' =&gt; 'Y-m',
'#default_value' =&gt; date('Y-m'),
'#date_year_range' =&gt; '-4:+0', 
);


This is the form submit:

$start_date = strtotime($date);
$query = "
SELECT `nid` FROM `node`
WHERE 
`type` = 'custom'
 AND `changed` &gt;= '$start_date'";


But I'm not getting, I need a way to specify to only this month period not this month and newer!

Thanks!
Here you go with the code.. I have used entity field query to retrieve results.. Code should be self explanatory..  Let me know if you have any difficulty in understanding below code..

&lt;?php

$year_month = "2014-04";
$date = date_parse_from_format ("Y-m" ,  $year_month);
$num = cal_days_in_month(CAL_GREGORIAN, $date['month'], $date['year']);
$first_minute = mktime(0, 0, 0, $date['month'], 1, $date['year']);
$last_minute = mktime(23, 59, 59, $date['month'], $num, $date['year']);
$entity_type = 'node';
$efq = new EntityFieldQuery();
$efq-&gt;entityCondition('entity_type', $entity_type);
$efq-&gt;propertyCondition('created', array($first_minute, $last_minute), 'BETWEEN');
$result = $efq-&gt;execute();  
dpm($result);

?&gt;