3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = '2018-06-08 15:20:30'; $dt = new \DateTimeImmutable($time); $di = new \DateInterval('PT15H20M30S'); echo $dt->format('Y-m-d H:i:s')."\n"; echo $di->format('%H:%I:%s')."\n"; echo strftime('%H:%I:%s', strtotime($time))."\n"; # %I = hodiny (01-12), %s = Unix epoch timestamp echo strftime('%H:%M:%S', strtotime($time));
Output for 8.4.1 - 8.4.12
2018-06-08 15:20:30 15:20:30 Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/1WLVk on line 8 15:03:-1 Deprecated: Function strftime() is deprecated since 8.1, use IntlDateFormatter::format() instead in /in/1WLVk on line 9 15:20:30
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25
2018-06-08 15:20:30 15:20:30 Deprecated: Function strftime() is deprecated in /in/1WLVk on line 8 15:03:-1 Deprecated: Function strftime() is deprecated in /in/1WLVk on line 9 15:20:30
Output for 7.2.6, 7.4.26 - 7.4.33, 8.0.14 - 8.0.30
2018-06-08 15:20:30 15:20:30 15:03:-1 15:20:30
Output for 7.3.32 - 7.3.33, 8.0.13
2018-06-08 15:20:30 15:20:30 15:03:1528471230 15:20:30
Output for 5.6.38, 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.5, 7.2.7 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 8.0.0 - 8.0.12
2018-06-08 15:20:30 15:20:30 15:03:1528464030 15:20:30

preferences:
139.99 ms | 412 KiB | 5 Q