3v4l.org

run code in 300+ 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.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
America/New_York int(1674252742) int(1674234742)

preferences:
88.45 ms | 406 KiB | 5 Q