Magento 1.9 Date Format – Localized Dutch Date Format

dateformatlocalisationmagento-1.9third-party-module

I'm using "AW blog" in Magento 1.9.3.2. On the homepage I've got the recently added blogs with the date, the date is now showing: 29 May 2017. How can I change that into Dutch like; 29 Mei 2017? I've tried several thing I found on the internet but I couldn't get it to work 🙁

This is the code:

<div class="lt-blog-info <?php if($i==1) echo $this->__('info-first-blog')?>">
    <div class="item-lb-title">
        <a title="<?php echo substr($post->getTitle(), 0, 25);?>" href="<?php echo $post->getAddress(); ?>"><span><?php echo substr($post->getTitle(), 0, 25); ?></span>
        </a>
    </div>
    <div class="w-agoday">
        <?php
            $date = $post->getCreatedTime();
            $dateToShow = date('j F Y',strtotime($date));
            echo $dateToShow;
        ?>
    </div>
    <div class="item-lb-description">
        <?php echo substr(strip_tags($post->getShortContent()), 0, 120);  ?>
    </div>
</div>

Best Answer

You can try this:

// based on configuration
// $locale = Mage::app()->getLocale()->getLocaleCode();
$locale = 'nl_NL';
$date = new Zend_Date($post->getCreatedTime());
$date->setLocale($locale);
echo $date->toString(Zend_Date::DATE_LONG);

Other date formates here: https://framework.zend.com/manual/1.10/en/zend.date.constants.html