How to change a specific Event’s timezone programmatically

Hello. I’m using the latest Events Manager version 6.4.6.4. I’m trying to change the timezone of a newly-created Event using code, but it won’t override the default timezone (which is set at the General Options).

$EM_Event = em_get_event($post_id, 'post_id');

// e.g. default timezone is 'Europe/Madrid' and will try to change it to 'Pacific/Pitcairn' for this Event
$EM_Event->set_timezone('Pacific/Pitcairn');

Also, the documentation seems to be wrong:

$EM_Event->setTimezone('Europe/Madrid');

The setTimezone() function does not exist for that class.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer