yii\i18n\Formatter::asTime a.m. vs AM

What could be possibly causing the following.


//PHP date class (development and production)

(new DateTime('00:00:00'))->format('h:i:s A'); //12:00:00 AM


//Yii2 Formatter (development)

$formatter = Yii::$app->formatter;

$formatter->timeFormat = 'php:h:i:s A';

$formatter->asTime('00:00:00'); //12:00:00 AM


//Yii2 Formatter (production)

$formatter = Yii::$app->formatter;

$formatter->timeFormat = 'php:h:i:s A';

$formatter->asTime('00:00:00'); //12:00:00 a.m.

you set the web file?


'formatter' => [

        'class' => 'yii\i18n\Formatter',

        'defaultTimeZone'=>'America/Sao_Paulo',

        'dateFormat' => 'php:d/m/Y',

        'datetimeFormat' => 'php:d/m/Y H:i:s',

        'timeFormat' => 'php:H:i:s',

        'decimalSeparator' => ',',

        'thousandSeparator' => '.',

        'currencyCode' => 'R$',

         ],

Yes, sure


'formatter' => [

            //'defaultTimeZone' => 'UTC',

            'timeZone' => 'America/Tijuana',

            'dateFormat' => 'php:Y/m/d',

            'datetimeFormat' => 'php:Y/m/d h:i:s A',

            'timeFormat' => 'php:h:i:s A',

        ],

PHP: Development 7.0.6, Production 5.6.23

Yii: 2.0.8

I don’t think it’s Yii either as “a.m.” is not in the repo. It could be a PHP 5.6 thing under(nor not) Yii influence.

I not understand, my php is 5.6, in my production is view 12:00:00 AM.

is it because of internationalization?

Do you mean PHP intl extension? I’ll check that out.