3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = date("Y-m-d H:i:s"); // current time; viz since I'm in India, it'll set Current Indian Time i.e. 2014-04-28 02:31:58 (exactly like this) $info['lastboot'] = "2014-04-28 01:55:55"; // I'm assuming this as your last boot time stored in your DB //Now to compare both the time value, convert them to exact seconds using PHP buit-in function `strtotime()` //What strtotime() does is convert the string date viz. 2014-04-28 02:31:58 into seconds. //These seconds are counted from the UNIX EPOCH i.e since 01 Jan 1970 00:00:00 $date_to_sec_1 = strtotime($date); $date_to_sec_2 = strtotime($info['lastboot']); if($date_to_sec_1 > $date_to_sec_2) { echo "You need to wait for ".($date_to_sec_1-$date_to_sec_2)." seconds before next boot"; } else { // else part }
Output for git.master, git.master_jit, rfc.property-hooks

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