Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1122832
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 3 months ago.
Improve this questionI created an event with the date 2024-06-18 and start_time 8:00am on the Time Zone Europe/Brussels. The wordpress is set on Asia/Hong_Kong timezone.
if i get the start time like this
$event_timezone = Tribe__Events__Timezones::get_event_timezone_string($event_id);
var_dump(tribe_get_start_time($event_id, 'g:i A', $event_timezone));
I get the start date 12:00 AM
if i get it like this:
$wp_timezone = date_default_timezone_get();
var_dump(tribe_get_start_time($event_id, 'g:i A', $wp_timezone));
i get 6:00 AM
If i don't specify the timezone parameter i get 12:00 AM
why i'm not getting 8:00am ? what am I'm doing wrong? is there a different field or what?
This does not make any sense. I disabled all the other plugin to take out of equation problems from other plugins.
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 3 months ago.
Improve this questionI created an event with the date 2024-06-18 and start_time 8:00am on the Time Zone Europe/Brussels. The wordpress is set on Asia/Hong_Kong timezone.
if i get the start time like this
$event_timezone = Tribe__Events__Timezones::get_event_timezone_string($event_id);
var_dump(tribe_get_start_time($event_id, 'g:i A', $event_timezone));
I get the start date 12:00 AM
if i get it like this:
$wp_timezone = date_default_timezone_get();
var_dump(tribe_get_start_time($event_id, 'g:i A', $wp_timezone));
i get 6:00 AM
If i don't specify the timezone parameter i get 12:00 AM
why i'm not getting 8:00am ? what am I'm doing wrong? is there a different field or what?
This does not make any sense. I disabled all the other plugin to take out of equation problems from other plugins.
Share Improve this question edited Oct 3, 2024 at 19:49 iulian.flester asked Oct 3, 2024 at 19:35 iulian.flesteriulian.flester 114 bronze badges 2- we don't know how work the functions of the plugin "tribe" then you will have more help in asking the developers of this plugin. – mmm Commented Oct 3, 2024 at 21:38
- i also posted on wordpress forum, no answer so far. – iulian.flester Commented Oct 4, 2024 at 6:59
1 Answer
Reset to default 1i checked the database and i found that the date tribe_get_start_time or the other one that is getting the day is using the meta _EventStartDateUTC and this must work perfect if your server is using utc timezone.
So I used _EventStartDate meta instead, this one is using the value from wordpress backend as far as I can see.
本文标签: The Events Calendar return the wrong start time
版权声明:本文标题:The Events Calendar return the wrong start time 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736285045a1927375.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论