WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Problem is that $today is pulling GMT from the database; I need to offset GMT by -6 hours; Have been unable to find a query with an offset like that.

   $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
   $today = date('Y-m-d');
   'post_type' => 'performance', 
   'posts_per_page' => 4, 
   'caller_get_posts' => 4, 
   'paged' => $paged,
   'meta_key' => 'order-date',
   'orderby' => 'meta_value',
   'order' => 'ASC',
       'meta_query' => array(
             'key' => 'order-date',
             'meta-value' => $value,
             'value' => $today,
             'compare' => '>=',
             'type' => 'CHAR'
  if (have_posts()) :
  while (have_posts()) : the_post();
share|improve this question
up vote 1 down vote accepted

Is WP set to that -6 offset you need? In that case try date_i18n() to generate your date instead of date().

share|improve this answer
Yes, WP is set to local timezone. I resolved the problem by using the following: $today = date('Y-m-d', strtotime('-6 hours')); Will test your suggestion. – Ray Gulick Jul 25 '11 at 13:15
@Ray Gulick yes, custom offset would be my second suggestion, but if you simply need it in WP's time then date_i18n() is less to think about. – Rarst Jul 25 '11 at 14:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.