我正在尝试检索今天的谷歌日历事件并显示在网页中。但谷歌日历仅在1小时后显示事件,即1:00。即使我试图将时区设置为“欧洲/柏林”,它仍然无效。
<?php
// load library
require_once 'Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
Zend_Loader::loadClass('Zend_Http_Client');
// create authenticated HTTP client for Calendar service
$gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$user = "email@gmail.com";
$pass = "password";
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $gcal);
$gdataCal = new Zend_Gdata_Calendar($client);
$query = $gdataCal->newEventQuery();
$query->setUser('default');
$query->setVisibility('private');
$query->setProjection('full');
$query->setOrderby('starttime');
date_default_timezone_set('Europe/Berlin');
$query->setStartMin(date('Y-m-d 00:00:00'));
$query->setStartMax(date('Y-m-d 23:59:59'));
$eventFeed = $gdataCal->getCalendarEventFeed($query);
?>
<div class='container display-toggle'>
<ul>
<?
foreach ($eventFeed as $event) {
?>
<li>
<ul>
<?
foreach ($event->when as $when) {
$startDateTime = new DateTime($when->startTime);
?>
<li class='body-watch-logo' data-event="<? echo $event->id; ?>" data-time="<? echo $when->startTime; ?>"></li>
<li><h3><? echo $startDateTime->format('H:i'); ?></h3></li>
<li>
<div class='span8 pull-left'>
<div class='text-box'>
<h5><? echo $event->title->text; ?></h5>
</div>
<div class='text-box'>
<h4>Find them at: </h4>
<p><? echo $event->where[0]; ?></p>
</div>
<div class='text-box'>
<h4>description: </h4>
<p><? echo $event->content; ?></p>
</div>
</div>
</li>
<?
}
$count++;
?>
</ul>
<hr>
</li>
<? } ?>
</ul>
问题是当我显示事件时它不会在00:00到1:00显示事件。
对于今天的比赛,名单在1:01之后开始。这是因为夏令时问题。
我已将时区放在谷歌日历中作为柏林,也作为柏林页面。但是今天00:00到1:00的活动仍未显示。
请帮帮我。