3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getFormattedDateTime($date, $timezone) { $datetime = DateTimeImmutable::createFromFormat( 'Y-m-d H:i:s', $date, new DateTimeZone( $timezone ) ); $rfc3339 = $datetime->format( DATE_RFC3339 ); var_dump($rfc3339); } $timezones = [ 'UTC', 'America/Regina', 'Europe/Kiev', ]; $date = '1970-01-01 00:00:00'; foreach ($timezones as $timezone) { getFormattedDateTime($date, $timezone); } $date = '2022-08-29 12:00:00'; foreach ($timezones as $timezone) { getFormattedDateTime($date, $timezone); }
Output for git.master, git.master_jit, rfc.property-hooks
string(25) "1970-01-01T00:00:00+00:00" string(25) "1970-01-01T00:00:00-06:00" string(25) "1970-01-01T00:00:00+03:00" string(25) "2022-08-29T12:00:00+00:00" string(25) "2022-08-29T12:00:00-06:00" string(25) "2022-08-29T12:00:00+03:00"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
31.58 ms | 405 KiB | 5 Q