3v4l.org

run code in 200+ PHP versions simultaneously
<?php $formatter = new IntlDateFormatter( 'en_US', IntlDateFormatter::NONE, IntlDateFormatter::NONE, 'America/Sao_Paulo', IntlDateFormatter::GREGORIAN, "yyyy-MM-dd HH:mm:ss" ); echo $formatter->format( new DateTime('2019-12-31 23:59:59', new DateTimeZone('America/Sao_Paulo')) );
based on 7ibRK
Output for 7.3.9 - 7.4.1
2020-01-01 00:59:59
Output for 7.2.0 - 7.3.8
2019-12-31 23:59:59