3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //following GMT value or offset get from api $offsetHours = '-5 hours'; // This time i get from api $currentValue = '1401705628'; $actualTimeStamp = strtotime($offsetHours,$currentValue); echo strtotime($offsetHours)."==="; echo $actualTimeStamp."==="; echo date('d-M-Y h:i A',$actualTimeStamp); echo "==mk=".mktime(-5, 0, 0, 0, 0, 0); echo "===".date("d-M-Y h:i A", $currentValue+mktime(-5, 0, 0, 0, 0, 0));
Output for 5.1.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
1401691397===1401687628===02-Jun-2014 07:40 AM==mk=943898400===30-Apr-2044 05:40 AM
Output for 4.3.0 - 4.4.9, 5.0.3 - 5.0.5
1401691397===1401687628===02-Jun-2014 07:40 AM==mk=-1===02-Jun-2014 12:40 PM
Output for 5.0.0 - 5.0.2
1401642000===1401642000===01-Jun-2014 07:00 PM==mk=-1===02-Jun-2014 12:40 PM