3v4l.org

run code in 500+ PHP versions simultaneously
<?php date_default_timezone_set('America/New_York'); echo date_default_timezone_get()."\n"; $dateStr = "20230120171222"; $timestamp1 = strtotime($dateStr); var_dump($timestamp1); $timestamp2 = strtotime($dateStr." UTC"); var_dump($timestamp2);
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.22, 8.5.0 - 8.5.7
America/New_York int(1674252742) int(1674234742)

preferences:
90.1 ms | 1125 KiB | 4 Q