3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = '13-09-2010 00:00:00'; date_default_timezone_set('IST'); $etc = (strtotime($date) * 1000) - (strtotime('02-01-1970 00:00:00') * 1000); echo $etc; echo "\n---------------------------------------------------------------------\n"; $str = strtotime($date); //Wed Oct 13 2010 05:30:00 GMT+0530 $ab = date("D M j Y G:i:s T", strtotime('02-01-1970 00:00:00')); echo $ab; echo "\n---------------------------------------------------------------------\n"; $datetime = new DateTime('Fri Jan 2 1970 0:00:00 UTC', new DateTimeZone('Asia/Calcutta')); $datetime->setTimezone(new DateTimeZone('Asia/Calcutta')); print $datetime->format('Y-m-d H:i:s (e)'); echo "\n---------------------------------------------------------------------\n"; $cur_time=date("Y-m-d H:i:s"); $curDate = '02-01-1970'; $input = array(1,7,3,5,9,2); $duration='+"echo array_rand($input, 1);"' minutes'; echo date('Y-m-d H:i:s', strtotime($duration, strtotime($curDate)));
Output for 7.1.0 - 7.1.12, 7.2.0
Parse error: syntax error, unexpected 'minutes' (T_STRING) in /in/ruvvr on line 27
Process exited with code 255.

preferences:
163.3 ms | 1395 KiB | 21 Q