How to get Time Zones in Moodle 3.1

How to get Time Zones in Moodle 3.1

by Pablo Escobar -
Number of replies: 1

Hi ppl,

I want to know how to get the Time Zones from Moodle 3.1, is there any table in the DB?. I want to add the time zones in a module that i am creating.

Before to Moodle 3.1, i was getting the time zones from table mdl_timezone, but this table dissapears in moodle 3.1.

Any suggestion, any other idea of how to get time zones in Moodle 3.1

Thanks in Advance

Average of ratings: -
In reply to Pablo Escobar

Re: How to get Time Zones in Moodle 3.1

by Olumuyiwa Taiwo -
Picture of Plugin developers

There is a static function

get_list_of_timezones()

in the core_date class (in lib/classes/date.php). So you probably want to do something like

$timezones = core_date::get_list_of_timezones()