3v4l.org

run code in 300+ PHP versions simultaneously
<?php setlocale(LC_TIME, 'he_IL'); $date = '20230121'; $date_from_format = DateTime::createFromFormat('Ymd', $date, new DateTimeZone('Europe/Berlin')); print_r([ $date_from_format->format('j'), $date_from_format->format('F'), $date_from_format->format('Y'), ]);
Output for 8.0.1 - 8.0.27, 8.1.0 - 8.1.14, 8.2.0 - 8.2.1
Array ( [0] => 21 [1] => January [2] => 2023 )

preferences:
19.86 ms | 406 KiB | 5 Q