Hi All, 
I have a little problem with Zend Date and date conversion using translated 
date strings.
Actually I'm doing tests using italian and english locale

If I do:

        $lcode = 'it_IT';
        $value = '11 Aprile 2011';
        $inputFormat = 'dd MMMM yyyy';
        $outputFormat = 'yyyy-MM-dd';

        $locale = new Zend_Locale( $lcode );
        $date = new Zend_Date($value, $inputFormat, $locale);
        echo ucwords( $date->toString( $outputFormat ) );

I get the error: Unable to parse date '11 Aprile 2011' using 'dd MMMM yyyy' (M 
<> d)

while if I use lowercase date value it works.



If I use english locale and string

        $lcode = 'en_EN';
        $value = '11 april 2011';
        $inputFormat = 'dd MMMM yyyy';
        $outputFormat = 'yyyy-MM-dd';
        
        $locale = new Zend_Locale( $lcode );
        $date = new Zend_Date($value, $inputFormat, $locale);
        echo $date->toString( $outputFormat );

I get the error: Unable to parse date '11 april 2011' using 'dd MMMM yyyy' (M 
<> d)

while if I use first letter capitalized date value it works.


Is this a normal behaviour? Any advices on how to fix?


Thanks



Sergio Rinaudo


                                          

Reply via email to