How to get the time zone value

how to get timezone dropdown menu in frontend magento?

+3
source share
1 answer

Here is the code to get all the time intervals : -

$timezones = Mage::getModel('core/locale')->getOptionTimezones();
echo "<pre>"; 
    print_r($timezones); 
echo "</pre>";

You will get an array. You can scroll through the array and fill in the selection / drop-down list as shown below: -

<select>
<?php
foreach($timezones as $timezone) {
    ?>
    <option value="<?php echo $timezone['value']; ?>"><?php echo $timezone['label']; ?></option>
    <?php
}
?>
</select>

Thank.

+7
source

All Articles