admin管理员组

文章数量:1122832

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 question

I 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 question

I 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
Add a comment  | 

1 Answer 1

Reset to default 1

i 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