3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $timestamp = new DateTime('23:30:00', new DateTimeZone('Europe/Dublin')); // time when you fetched the UTC time ^^^^^^^^ $timestamp->setTimezone(new DateTimeZone('UTC')); $timestamp->setTime($hours, $minutes, $seconds); echo $timestamp->format('Y-m-d H:i:s');
based on PjvKa
Output for 5.6.28, 7.0.14 - 7.1.0
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2014-08-20 00:00:00
Output for 7.0.6
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-05-03 00:00:00
Output for 5.6.14, 7.0.5
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-02 00:00:00
Output for 7.0.4
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-10 00:00:00
Output for 7.0.3
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-18 00:00:00
Output for 7.0.2
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-22 00:00:00
Output for 7.0.1
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-23 00:00:00
Output for 7.0.0
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-26 00:00:00
Output for hhvm-3.12.0
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-11 00:00:00
Output for hhvm-3.10.0
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-30 00:00:00
Output for 5.6.21
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-05-02 00:00:00
Output for 5.6.20
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-09 00:00:00
Output for 5.6.19
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-07 00:00:00
Output for 5.6.18
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-15 00:00:00
Output for 5.6.17
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-19 00:00:00
Output for 5.6.16
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-27 00:00:00
Output for 5.6.15
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-28 00:00:00
Output for 5.6.13
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-15 00:00:00
Output for 5.6.12
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-19 00:00:00
Output for 5.6.11
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-23 00:00:00
Output for 5.6.10
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-25 00:00:00
Output for 5.6.9
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-27 00:00:00
Output for 5.6.8
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-29 00:00:00
Output for 5.5.35
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-05-22 00:00:00
Output for 5.5.34
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-10 00:00:00
Output for 5.5.33
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-08 00:00:00
Output for 5.5.32
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-17 00:00:00
Output for 5.5.31
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-03-20 00:00:00
Output for 5.5.30
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-01 00:00:00
Output for 5.5.29
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-16 00:00:00
Output for 5.5.28
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-20 00:00:00
Output for 5.5.27
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-22 00:00:00
Output for 5.5.26
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-26 00:00:00
Output for 5.5.25
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-04-28 00:00:00
Output for 5.5.24
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2016-05-23 00:00:00
Output for 5.2.0 - 5.4.45
Notice: Undefined variable: hours in /in/IOYq6 on line 6 Notice: Undefined variable: minutes in /in/IOYq6 on line 6 Notice: Undefined variable: seconds in /in/IOYq6 on line 6 2015-11-18 00:00:00
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/IOYq6 on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/IOYq6 on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/IOYq6 on line 3