电子邮件卡显示正确的时间,日历没有
我已经批准了活动卡并有效。 Gmail中的卡显示了正确的时间(柏林,柏林,晚上10点),但在Google日历上显示为上午7点。
当我创建卡时,我将日期从柏林转换为UTC,然后返回ISO 8601格式的日期:
$dt = new \DateTime($dateString, new \DateTimeZone($this->timezone ?? \Phpr::$config->get('TIMEZONE')));
$dt->setTimezone(new \DateTimeZone("UTC"));
return $dt->format("c");
这是结果标记:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EventReservation",
"reservationNumber": "2400071",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"@type": "Person",
"name": "Some dude's name"
},
"reservationFor": {
"@type": "Event",
"name": "Demo Event Flux (1)",
"startDate": "2022-05-07T22:00:00+10:00",
"endDate": "2022-05-08T03:00:00+10:00",
"url": "https://www.yyy.zzz/event/demo-event-fl-1",
"location": {
"@type": "Place",
"name": "Berlin Central Station",
"address": {
"@type": "PostalAddress",
"streetAddress": "Europaplatz 1",
"addressLocality": "Berlin",
"addressRegion": "Berlin",
"postalCode": "10557",
"addressCountry": "DE"
}
}
}
}
</script>
我不确定,但是这似乎是日历问题,而不是架构问题。 也许日历没有足够的信息来了解精确的时区? 也许我的conversion依是错误的。
这发生在你身上吗? 谢谢
I've got my Event Card approved and working. The card in Gmail shows the correct time (10pm Berlin, DE) but on the Google calendar it shows as 7am.
When I create the card I convert the date from Berlin to UTC and return the date in ISO 8601 format:
$dt = new \DateTime($dateString, new \DateTimeZone($this->timezone ?? \Phpr::$config->get('TIMEZONE')));
$dt->setTimezone(new \DateTimeZone("UTC"));
return $dt->format("c");
and this is the resulting markup:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EventReservation",
"reservationNumber": "2400071",
"reservationStatus": "http://schema.org/Confirmed",
"underName": {
"@type": "Person",
"name": "Some dude's name"
},
"reservationFor": {
"@type": "Event",
"name": "Demo Event Flux (1)",
"startDate": "2022-05-07T22:00:00+10:00",
"endDate": "2022-05-08T03:00:00+10:00",
"url": "https://www.yyy.zzz/event/demo-event-fl-1",
"location": {
"@type": "Place",
"name": "Berlin Central Station",
"address": {
"@type": "PostalAddress",
"streetAddress": "Europaplatz 1",
"addressLocality": "Berlin",
"addressRegion": "Berlin",
"postalCode": "10557",
"addressCountry": "DE"
}
}
}
}
</script>
I'm not sure, but seems that this is a Calendar problem, not a schema problem.
Maybe Calendar doesn't have enough information to know the precise timezone?
Maybe my conversion is wrong.
Has this happened to you?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论