3v4l.org

run code in 300+ PHP versions simultaneously
<?php function converteData($format, $to_format, $date, $timezone = null) { if (!$timezone) { $timezone = new DateTimeZone(date_default_timezone_get()); } $d = date_create_from_format($format, $date, $timezone); return date_format($d, $to_format); } /* * Exemplos */ var_dump(converteData('d m Y', 'Y-m-d', '06 02 2025')); //2025-02-06 var_dump(converteData('d-m-Y', 'm/d/Y H:i', '06-02-2025')); //2025-02-06 12:38 var_dump(converteData('Y-m-d', 'l F Y H:i', '2014-02-06')); //Thursday February 2014
Output for git.master, git.master_jit, rfc.property-hooks
string(10) "2025-02-06" string(16) "02/06/2025 12:38" string(29) "Thursday February 2014 12:38"

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:
40.44 ms | 401 KiB | 8 Q