• Resolved lov4mu6

    (@lov4mu6)


    Hi guys!

    Thank you for a great product! Conditional statements [if-now] in the event builder were not working properly so I looked at the code and found that GMT time was not handled properly. You may wish to consider this for the current release.

    Here is the fixed that worked for me. Live page is here: https://sungatescenter.com/sungates-radio/

    gce-feed.php

    /*
    in the original code, gmt_offset was subtracted from $this->feed_start and $this->feed_end. This is incorrect as gmt_offset can either be negative or positive. In Chicago, gmt_offset is -7 hours so two minuses made a plus.
    */
    
    $gmt_offset = get_option( 'gmt_offset' ) * 3600;
    
    //Append the feed specific parameters to the querystring
    $query .= '&start-min=' . date( 'Y-m-d\TH:i:s', $this->feed_start + $gmt_offset );
    $query .= '&start-max=' . date( 'Y-m-d\TH:i:s', $this->feed_end + $gmt_offset );

    —————–
    gce-parser.php:

    //gmt_offset was missing, as a result now date_time value was incorrect.
    
    case 'now':
    
    $gmt_offset = get_option( 'gmt_offset' ) * 3600;
    
    $datetime_now = mktime( date( 'H' ), date( 'i' ), 0, date( 'm' ), date( 'j' ), date( 'Y' ) ) + $feed_options['retrieve_from_value'] + $gmt_offset;
    
    $feed->set_feed_start( $datetime_now );

    Hope this helps!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Important fix for handling GMT time (concerns Event Builder)’ is closed to new replies.