How to get timezone value

how to get the timezone drop down menu in frontend magento?

One thought on “How to get timezone value”

  1. Here is the code to get all timezones:-

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

    You will be getting an array. You can loop through the array and populate the selection/dropdown list like below:-

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

    Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *