{"id":26073,"date":"2012-10-04T05:59:21","date_gmt":"2012-10-04T12:59:21","guid":{"rendered":"http:\/\/tri.be\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/"},"modified":"2015-07-07T06:26:29","modified_gmt":"2015-07-07T13:26:29","slug":"maybe-usefull-code-for-timezones-fix","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/","title":{"rendered":"Maybe usefull code for timezones fix"},"content":{"rendered":"<p>Okay i&#8217;ve written for my clients own simple fb_stream_events and all times are set correct. I post the here and hope this will help to find the problem inside facebook_importer<br \/>\n &#8216;196555860474817&#8217;,<br \/>\n\t&#8216;secret&#8217; =&gt; &#8216;925d3a7df5534746b92541aff1daa8d4&#8217;,<br \/>\n\t&#8216;cookie&#8217; =&gt; true, \/\/ enable optional cookie support<br \/>\n));<\/p>\n<p>\/\/ Attempt to fetch kultmarks&#8217;s events page<br \/>\n\/\/ place access token for your fanpage after events?access_token=<br \/>\n\/\/ also place your fanpage that you would like to pull events from in $events=$facebook-&gt;api(&#8216;\/fanpage_here\/<br \/>\ntry{<br \/>\n$fql = &#8220;SELECT eid, name, location, description, pic_big, start_time FROM event<br \/>\n    WHERE creator = &#8216;$fbNameToId&#8217; AND eid IN<br \/>\n    (SELECT eid FROM event_member WHERE uid = &#8216;$fbNameToId&#8217;)<br \/>\n    ORDER BY start_time asc LIMIT 5&#8243;;<br \/>\n$param  =   array(<br \/>\n    &#8216;method&#8217; =&gt; &#8216;fql.query&#8217;,<br \/>\n    &#8216;query&#8217; =&gt; $fql,<br \/>\n    &#8216;callback&#8217; =&gt; &#8221;<br \/>\n);<br \/>\n\t$events=$facebook-&gt;api($param);<br \/>\n}catch (FacebookApiException $e){<br \/>\n\terror_log($e);<br \/>\n}<\/p>\n<p>\/\/ Iterate through each event<br \/>\nforeach ($events as $event){<br \/>\n\t\/\/ Get the start time of the event and convert it to a UNIX timestamp (hopefully)<\/p>\n<p>\t\t\/\/ If the time falls within a day, show the event details. If the event is after today, show it as well.<br \/>\n\t\t\/\/ 60 (seconds\/minute) * (60 minutes\/hour) * 24 (hours\/day) * 1 (day)<\/p>\n<p>\t\t\ttry{<br \/>\n\t\t\t\t\/\/ Fetch more details about the event<br \/>\n\t\t\t\t$start_time = date(&#8216;M j, Y H:i &#8216;, strtotime($event[&#8216;start_time&#8217;]));<br \/>\n\t\t\t\t}catch (FacebookApiException $e){<br \/>\n\t\t\t\t\t\/\/ We errored \ud83d\ude41<br \/>\n\t\t\t\t\terror_log($e);<br \/>\n\t\t\t\t\t}<\/p>\n<p>\t\t\t\t\t\/\/ Show some HTMLsauce<br \/>\n\t\t\t\t\t?&gt;<\/p>\n<p>                                        <a href=\"#\" title=\"\"><\/p>\n<p>                                        &lt;a href=&quot;http:\/\/www.facebook.com\/event.php?eid=&#8221;&gt;<\/a><br \/>\n                                        <b><\/b> <\/a><\/p>\n","protected":false},"template":"","class_list":["post-26073","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Maybe usefull code for timezones fix -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Maybe usefull code for timezones fix -\" \/>\n<meta property=\"og:description\" content=\"Okay i&#8217;ve written for my clients own simple fb_stream_events and all times are set correct. I post the here and hope this will help to find the problem inside facebook_importer &#8216;196555860474817&#8217;, &#8216;secret&#8217; =&gt; &#8216;925d3a7df5534746b92541aff1daa8d4&#8217;, &#8216;cookie&#8217; =&gt; true, \/\/ enable optional cookie support )); \/\/ Attempt to fetch kultmarks&#8217;s events page \/\/ place access token for [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/\" \/>\n<meta property=\"article:modified_time\" content=\"2015-07-07T13:26:29+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/\",\"name\":\"Maybe usefull code for timezones fix -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2012-10-04T12:59:21+00:00\",\"dateModified\":\"2015-07-07T13:26:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Event Aggregator\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/event-aggregator\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Maybe usefull code for timezones fix\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Maybe usefull code for timezones fix -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/","og_locale":"en_US","og_type":"article","og_title":"Maybe usefull code for timezones fix -","og_description":"Okay i&#8217;ve written for my clients own simple fb_stream_events and all times are set correct. I post the here and hope this will help to find the problem inside facebook_importer &#8216;196555860474817&#8217;, &#8216;secret&#8217; =&gt; &#8216;925d3a7df5534746b92541aff1daa8d4&#8217;, &#8216;cookie&#8217; =&gt; true, \/\/ enable optional cookie support )); \/\/ Attempt to fetch kultmarks&#8217;s events page \/\/ place access token for [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/","article_modified_time":"2015-07-07T13:26:29+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/","name":"Maybe usefull code for timezones fix -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2012-10-04T12:59:21+00:00","dateModified":"2015-07-07T13:26:29+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/maybe-usefull-code-for-timezones-fix\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Event Aggregator","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/event-aggregator\/"},{"@type":"ListItem","position":5,"name":"Maybe usefull code for timezones fix"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/26073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/26073\/revisions"}],"predecessor-version":[{"id":978557,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/26073\/revisions\/978557"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=26073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}