How can I create a programmatic Search API query which uses a date field I'm trying to create a programmatic Search API query. I've successfully created one which looks for all nodes which are published:

  $index = search_api_index_load("node_index");
  $myQuery=new SearchApiQuery($index);
  $myQuery-&gt;condition('status', '1', '=');
  $data=$myQuery-&gt;execute();
  $results=$data['results'];


However the condition that I want to search for is to find all nodes with a certain date on a date field.

The problem is I can't work out how the Search API stores dates. I've tried UNIX time stamps:

  $myQuery-&gt;condition('field_application_end_date', '1411084800', '=');


And the PHP date format that is stored on the nodes however neither returns any results.

  $myQuery-&gt;condition('field_application_end_date', '2014-10-01T00:00:00', '=');


Can someone explain how the Search API stores dates?

I've been digging through the module to try and work out how it's done, but it's a little out of my league.
Try

$myQuery-&gt;condition('field_application_end_date:value', '1411084800', '=');


Search API stores the dates as timestamps, so you're right there, but you forgot the 'value' after the field. If you want to use the 'to' date, use 'value2'.