3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "2019-08-10D00:00:03.712125000"; $parts = explode(".", $string); $microseconds = $parts[1]; $date = DateTime::createFromFormat("Y-m-d\DH:i:s", $parts[0]); $timestamp = $date->getTimestamp(); // If you want to round it to 4 decimal places // $microseconds = ltrim(round("0.".$microseconds, 4), "0."); // If you want to append the microseconds back for whichever reason // $timestamp .= ".".$microseconds; echo $timestamp;
Output for git.master, git.master_jit, rfc.property-hooks
1565388003

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:
62.08 ms | 405 KiB | 5 Q