Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

<?php
   $paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
   $today = date('Y-m-d');
   query_posts(array(
   '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(
           array(
             'key' => 'order-date',
             'meta-value' => $value,
             'value' => $today,
             'compare' => '>=',
             'type' => 'CHAR'
         )
      )
    ));
  if (have_posts()) :
  while (have_posts()) : the_post();
?>
share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.