Hi all
I’m having a problem getting CDateFormatter to correctly interpret the UK date format (dd/MM/yyyy). It treats dates that I pass to it as US format (MM/dd/yyyy).
For example:
<?php echo Yii::app()->dateFormatter->format("yyyy-MM-dd","01/03/2010"); ?>
This produces 2010-01-03 rather than 2010-03-01.
I have set the locale in config/main.php as follows:
array('language'=>'en_gb')
I have also tried constructing CDataFormatter with the locale as follows:
<?php $df = new CDateFormatter('en_gb'); ?>
However, neither of these have made a difference.
What do I need to do to get CDateFormatter to handle the UK date format correctly?
Many thanks.