title: Compare the current date to a timestamp in Wordpress with meta_query
body: <p>I would like to make a query to compare the current date to a date in the database. This way I would show events that happened before today.</p>
  
  <p>I tried the meta_query but all events are shown. </p>
  
  <pre><code> 'meta_query' =&gt; array(
           array(
               'key'     =&gt; 'event_start_date_number',
               'value'   =&gt; date('Y-m-d'),
               'compare' =&gt; '&lt;=',
               'type' =&gt; 'DATETIME,'
           ),
      ),
  </code></pre>
  
  <p>For reference in my database I got many records that looks like this: </p>
  
  <pre><code>meta_key: event_start_date_number
  meta_value: 1472576400
  </code></pre>
  
  <p>And they was saved this way:</p>
  
  <pre><code>$date = "".$event_start_date." ".$event_start_time."";
  $event_start_date_number = strtotime($date);
  if(!empty($event_start_date_number)) {
      update_post_meta($post_id, 'event_start_date_number', $event_start_date_number);
  }
  </code></pre>