I'm having an odd problem getting timezones to show in the JSON results of Time/FrozenTime objects in CakePHP 3.5 after migrating our application to PHP 7.2 and to a new server environment.
A simplified example occurs when formatting a new Cake\I18n\Time like so:
(new Time())->i18nFormat("yyyy-MM-dd'T'HH:mm:ssxxx")
Previously this would return a string like so:
2020-01-31T10:57:43-07:00
However in our new environment, the same code fails to return the timezone portion, instead returning results like:
2020-01-31T10:57:43
Internally, tracing i18nFormat through to Cake\I18n\DateFormatTrait::_formatObject
, they both seem to be calling the exact same parameters to datefmt_create:
static::$_formatters[$key] = datefmt_create(
'America/Denver',
0,
0,
'America/Denver',
1,
'yyyy-MM-dd\'T\'HH:mm:ssxxx');
But this seems to return different results, the "xxx" portion has no effect.
Is there some environment setting that would effect this? Or is it caused by something else?
How can I get the timezone portion back?