3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $date = new DateTime(null); echo 'Default timezone: '.$date->getTimestamp().'<br />'."\r\n"; //America/New_York $date = new DateTime(null, new DateTimeZone('America/New_York')); echo 'America/New_York: '.$date->getTimestamp().'<br />'."\r\n"; //Europe/Amsterdam $date = new DateTime(null, new DateTimeZone('Europe/Amsterdam')); echo 'Europe/Amsterdam: '.$date->getTimestamp().'<br />'."\r\n"; echo 'WORK AROUND<br />'."\r\n"; // WORK AROUND //default timezone $date = new DateTime(null); echo 'Default timezone: '.($date->getTimestamp() + $date->getOffset()).'<br />'."\r\n"; //America/New_York $date = new DateTime(null, new DateTimeZone('America/New_York')); echo 'America/New_York: '.($date->getTimestamp() + $date->getOffset()).'<br />'."\r\n"; //Europe/Amsterdam $date = new DateTime(null, new DateTimeZone('Europe/Amsterdam')); echo 'Europe/Amsterdam: '.($date->getTimestamp() + $date->getOffset()).'<br />'."\r\n"; ?>
Output for 7.0.14 - 7.1.0
Default timezone: 1394711461<br /> America/New_York: 1394711461<br /> Europe/Amsterdam: 1394711461<br /> WORK AROUND<br /> Default timezone: 1394715061<br /> America/New_York: 1394697061<br /> Europe/Amsterdam: 1394715061<br />
Output for 7.0.7
Default timezone: 1394715061<br /> America/New_York: 1394715061<br /> Europe/Amsterdam: 1394715061<br /> WORK AROUND<br /> Default timezone: 1394718661<br /> America/New_York: 1394700661<br /> Europe/Amsterdam: 1394718661<br />
Output for 7.0.6
Default timezone: 1462224421<br /> America/New_York: 1462224421<br /> Europe/Amsterdam: 1462224421<br /> WORK AROUND<br /> Default timezone: 1462231621<br /> America/New_York: 1462210021<br /> Europe/Amsterdam: 1462231621<br />
Output for 7.0.5
Default timezone: 1459594865<br /> America/New_York: 1459594865<br /> Europe/Amsterdam: 1459594865<br /> WORK AROUND<br /> Default timezone: 1459602065<br /> America/New_York: 1459580465<br /> Europe/Amsterdam: 1459602065<br />
Output for 7.0.4
Default timezone: 1457556657<br /> America/New_York: 1457556657<br /> Europe/Amsterdam: 1457556657<br /> WORK AROUND<br /> Default timezone: 1457560257<br /> America/New_York: 1457538657<br /> Europe/Amsterdam: 1457560257<br />
Output for 7.0.3
Default timezone: 1458249345<br /> America/New_York: 1458249345<br /> Europe/Amsterdam: 1458249345<br /> WORK AROUND<br /> Default timezone: 1458252945<br /> America/New_York: 1458234945<br /> Europe/Amsterdam: 1458252945<br />
Output for 7.0.2
Default timezone: 1458547215<br /> America/New_York: 1458547215<br /> Europe/Amsterdam: 1458547215<br /> WORK AROUND<br /> Default timezone: 1458550815<br /> America/New_York: 1458532815<br /> Europe/Amsterdam: 1458550815<br />
Output for 7.0.1
Default timezone: 1458718713<br /> America/New_York: 1458718713<br /> Europe/Amsterdam: 1458718713<br /> WORK AROUND<br /> Default timezone: 1458722313<br /> America/New_York: 1458704313<br /> Europe/Amsterdam: 1458722313<br />
Output for 7.0.0
Default timezone: 1458989483<br /> America/New_York: 1458989483<br /> Europe/Amsterdam: 1458989483<br /> WORK AROUND<br /> Default timezone: 1458993083<br /> America/New_York: 1458975083<br /> Europe/Amsterdam: 1458993083<br />
Output for 5.6.21
Default timezone: 1462120325<br /> America/New_York: 1462120325<br /> Europe/Amsterdam: 1462120325<br /> WORK AROUND<br /> Default timezone: 1462127525<br /> America/New_York: 1462105925<br /> Europe/Amsterdam: 1462127525<br />
Output for 5.6.20
Default timezone: 1460182818<br /> America/New_York: 1460182818<br /> Europe/Amsterdam: 1460182818<br /> WORK AROUND<br /> Default timezone: 1460190018<br /> America/New_York: 1460168418<br /> Europe/Amsterdam: 1460190018<br />
Output for 5.6.19
Default timezone: 1457286574<br /> America/New_York: 1457286574<br /> Europe/Amsterdam: 1457286574<br /> WORK AROUND<br /> Default timezone: 1457290174<br /> America/New_York: 1457268574<br /> Europe/Amsterdam: 1457290174<br />
Output for 5.6.18
Default timezone: 1457936115<br /> America/New_York: 1457936115<br /> Europe/Amsterdam: 1457936115<br /> WORK AROUND<br /> Default timezone: 1457939715<br /> America/New_York: 1457921715<br /> Europe/Amsterdam: 1457939715<br />
Output for 5.6.17
Default timezone: 1458352152<br /> America/New_York: 1458352152<br /> Europe/Amsterdam: 1458352152<br /> WORK AROUND<br /> Default timezone: 1458355752<br /> America/New_York: 1458337752<br /> Europe/Amsterdam: 1458355752<br />
Output for 5.6.16
Default timezone: 1459078423<br /> America/New_York: 1459078423<br /> Europe/Amsterdam: 1459078423<br /> WORK AROUND<br /> Default timezone: 1459085623<br /> America/New_York: 1459064023<br /> Europe/Amsterdam: 1459085623<br />
Output for 5.6.15
Default timezone: 1459167843<br /> America/New_York: 1459167843<br /> Europe/Amsterdam: 1459167843<br /> WORK AROUND<br /> Default timezone: 1459175043<br /> America/New_York: 1459153443<br /> Europe/Amsterdam: 1459175043<br />
Output for 5.6.14
Default timezone: 1459523855<br /> America/New_York: 1459523855<br /> Europe/Amsterdam: 1459523855<br /> WORK AROUND<br /> Default timezone: 1459531055<br /> America/New_York: 1459509455<br /> Europe/Amsterdam: 1459531055<br />
Output for 5.6.13
Default timezone: 1460661254<br /> America/New_York: 1460661254<br /> Europe/Amsterdam: 1460661254<br /> WORK AROUND<br /> Default timezone: 1460668454<br /> America/New_York: 1460646854<br /> Europe/Amsterdam: 1460668454<br />
Output for 5.6.12
Default timezone: 1461053625<br /> America/New_York: 1461053625<br /> Europe/Amsterdam: 1461053625<br /> WORK AROUND<br /> Default timezone: 1461060825<br /> America/New_York: 1461039225<br /> Europe/Amsterdam: 1461060825<br />
Output for 5.6.11
Default timezone: 1461339300<br /> America/New_York: 1461339300<br /> Europe/Amsterdam: 1461339300<br /> WORK AROUND<br /> Default timezone: 1461346500<br /> America/New_York: 1461324900<br /> Europe/Amsterdam: 1461346500<br />
Output for 5.6.10
Default timezone: 1461517940<br /> America/New_York: 1461517940<br /> Europe/Amsterdam: 1461517940<br /> WORK AROUND<br /> Default timezone: 1461525140<br /> America/New_York: 1461503540<br /> Europe/Amsterdam: 1461525140<br />
Output for 5.6.9
Default timezone: 1461708535<br /> America/New_York: 1461708535<br /> Europe/Amsterdam: 1461708535<br /> WORK AROUND<br /> Default timezone: 1461715735<br /> America/New_York: 1461694135<br /> Europe/Amsterdam: 1461715735<br />
Output for 5.6.8
Default timezone: 1461908881<br /> America/New_York: 1461908881<br /> Europe/Amsterdam: 1461908881<br /> WORK AROUND<br /> Default timezone: 1461916081<br /> America/New_York: 1461894481<br /> Europe/Amsterdam: 1461916081<br />
Output for 5.6.7
Default timezone: 1464103142<br /> America/New_York: 1464103142<br /> Europe/Amsterdam: 1464103142<br /> WORK AROUND<br /> Default timezone: 1464110342<br /> America/New_York: 1464088742<br /> Europe/Amsterdam: 1464110342<br />
Output for 5.5.35
Default timezone: 1463859523<br /> America/New_York: 1463859523<br /> Europe/Amsterdam: 1463859523<br /> WORK AROUND<br /> Default timezone: 1463866723<br /> America/New_York: 1463845123<br /> Europe/Amsterdam: 1463866723<br />
Output for 5.5.34
Default timezone: 1460288658<br /> America/New_York: 1460288658<br /> Europe/Amsterdam: 1460288658<br /> WORK AROUND<br /> Default timezone: 1460295858<br /> America/New_York: 1460274258<br /> Europe/Amsterdam: 1460295858<br />
Output for 5.5.33
Default timezone: 1457423926<br /> America/New_York: 1457423926<br /> Europe/Amsterdam: 1457423926<br /> WORK AROUND<br /> Default timezone: 1457427526<br /> America/New_York: 1457405926<br /> Europe/Amsterdam: 1457427526<br />
Output for 5.5.32
Default timezone: 1458061442<br /> America/New_York: 1458061442<br /> Europe/Amsterdam: 1458061442<br /> WORK AROUND<br /> Default timezone: 1458065042<br /> America/New_York: 1458047042<br /> Europe/Amsterdam: 1458065042<br />
Output for 5.5.31
Default timezone: 1458449192<br /> America/New_York: 1458449192<br /> Europe/Amsterdam: 1458449192<br /> WORK AROUND<br /> Default timezone: 1458452792<br /> America/New_York: 1458434792<br /> Europe/Amsterdam: 1458452792<br />
Output for 5.5.30
Default timezone: 1459435009<br /> America/New_York: 1459435009<br /> Europe/Amsterdam: 1459435009<br /> WORK AROUND<br /> Default timezone: 1459442209<br /> America/New_York: 1459420609<br /> Europe/Amsterdam: 1459442209<br />
Output for 5.5.29
Default timezone: 1460797860<br /> America/New_York: 1460797860<br /> Europe/Amsterdam: 1460797860<br /> WORK AROUND<br /> Default timezone: 1460805060<br /> America/New_York: 1460783460<br /> Europe/Amsterdam: 1460805060<br />
Output for 5.5.28
Default timezone: 1461151030<br /> America/New_York: 1461151030<br /> Europe/Amsterdam: 1461151030<br /> WORK AROUND<br /> Default timezone: 1461158230<br /> America/New_York: 1461136630<br /> Europe/Amsterdam: 1461158230<br />
Output for 5.5.27
Default timezone: 1461247502<br /> America/New_York: 1461247502<br /> Europe/Amsterdam: 1461247502<br /> WORK AROUND<br /> Default timezone: 1461254702<br /> America/New_York: 1461233102<br /> Europe/Amsterdam: 1461254702<br />
Output for 5.5.26
Default timezone: 1461612312<br /> America/New_York: 1461612312<br /> Europe/Amsterdam: 1461612312<br /> WORK AROUND<br /> Default timezone: 1461619512<br /> America/New_York: 1461597912<br /> Europe/Amsterdam: 1461619512<br />
Output for 5.5.25
Default timezone: 1461806967<br /> America/New_York: 1461806967<br /> Europe/Amsterdam: 1461806967<br /> WORK AROUND<br /> Default timezone: 1461814167<br /> America/New_York: 1461792567<br /> Europe/Amsterdam: 1461814167<br />
Output for 5.5.24
Default timezone: 1462007698<br /> America/New_York: 1462007698<br /> Europe/Amsterdam: 1462007698<br /> WORK AROUND<br /> Default timezone: 1462014898<br /> America/New_York: 1461993298<br /> Europe/Amsterdam: 1462014898<br />
Output for 5.4.45
Default timezone: 1441897204<br /> America/New_York: 1441897204<br /> Europe/Amsterdam: 1441897204<br /> WORK AROUND<br /> Default timezone: 1441904404<br /> America/New_York: 1441882804<br /> Europe/Amsterdam: 1441904404<br />
Output for 5.4.44
Default timezone: 1440964888<br /> America/New_York: 1440964888<br /> Europe/Amsterdam: 1440964888<br /> WORK AROUND<br /> Default timezone: 1440972088<br /> America/New_York: 1440950488<br /> Europe/Amsterdam: 1440972088<br />
Output for 5.4.43
Default timezone: 1440964885<br /> America/New_York: 1440964885<br /> Europe/Amsterdam: 1440964885<br /> WORK AROUND<br /> Default timezone: 1440972085<br /> America/New_York: 1440950485<br /> Europe/Amsterdam: 1440972085<br />
Output for 5.4.42
Default timezone: 1440964884<br /> America/New_York: 1440964884<br /> Europe/Amsterdam: 1440964884<br /> WORK AROUND<br /> Default timezone: 1440972084<br /> America/New_York: 1440950484<br /> Europe/Amsterdam: 1440972084<br />
Output for 5.4.41
Default timezone: 1440964882<br /> America/New_York: 1440964882<br /> Europe/Amsterdam: 1440964882<br /> WORK AROUND<br /> Default timezone: 1440972082<br /> America/New_York: 1440950482<br /> Europe/Amsterdam: 1440972082<br />
Output for 5.4.40
Default timezone: 1440964879<br /> America/New_York: 1440964879<br /> Europe/Amsterdam: 1440964879<br /> WORK AROUND<br /> Default timezone: 1440972079<br /> America/New_York: 1440950479<br /> Europe/Amsterdam: 1440972079<br />
Output for 5.4.39
Default timezone: 1440964878<br /> America/New_York: 1440964878<br /> Europe/Amsterdam: 1440964878<br /> WORK AROUND<br /> Default timezone: 1440972078<br /> America/New_York: 1440950478<br /> Europe/Amsterdam: 1440972078<br />
Output for 5.4.38
Default timezone: 1425128755<br /> America/New_York: 1425128755<br /> Europe/Amsterdam: 1425128755<br /> WORK AROUND<br /> Default timezone: 1425132355<br /> America/New_York: 1425110755<br /> Europe/Amsterdam: 1425132355<br />
Output for 5.4.36 - 5.4.37
Default timezone: 1423086112<br /> America/New_York: 1423086112<br /> Europe/Amsterdam: 1423086112<br /> WORK AROUND<br /> Default timezone: 1423089712<br /> America/New_York: 1423068112<br /> Europe/Amsterdam: 1423089712<br />
Output for 5.4.35
Default timezone: 1416048646<br /> America/New_York: 1416048646<br /> Europe/Amsterdam: 1416048646<br /> WORK AROUND<br /> Default timezone: 1416052246<br /> America/New_York: 1416030646<br /> Europe/Amsterdam: 1416052246<br />
Output for 5.4.34
Default timezone: 1416048645<br /> America/New_York: 1416048645<br /> Europe/Amsterdam: 1416048645<br /> WORK AROUND<br /> Default timezone: 1416052245<br /> America/New_York: 1416030645<br /> Europe/Amsterdam: 1416052245<br />
Output for 5.4.32
Default timezone: 1409329102<br /> America/New_York: 1409329102<br /> Europe/Amsterdam: 1409329102<br /> WORK AROUND<br /> Default timezone: 1409336302<br /> America/New_York: 1409314702<br /> Europe/Amsterdam: 1409336302<br />
Output for 5.4.31
Default timezone: 1409329099<br /> America/New_York: 1409329099<br /> Europe/Amsterdam: 1409329099<br /> WORK AROUND<br /> Default timezone: 1409336299<br /> America/New_York: 1409314699<br /> Europe/Amsterdam: 1409336299<br />
Output for 5.4.28 - 5.4.30
Default timezone: 1409329095<br /> America/New_York: 1409329095<br /> Europe/Amsterdam: 1409329095<br /> WORK AROUND<br /> Default timezone: 1409336295<br /> America/New_York: 1409314695<br /> Europe/Amsterdam: 1409336295<br />
Output for 5.4.27
Default timezone: 1409329100<br /> America/New_York: 1409329100<br /> Europe/Amsterdam: 1409329100<br /> WORK AROUND<br /> Default timezone: 1409336300<br /> America/New_York: 1409314700<br /> Europe/Amsterdam: 1409336300<br />
Output for 5.4.21 - 5.4.26
Default timezone: 1394711462<br /> America/New_York: 1394711462<br /> Europe/Amsterdam: 1394711462<br /> WORK AROUND<br /> Default timezone: 1394715062<br /> America/New_York: 1394697062<br /> Europe/Amsterdam: 1394715062<br />
Output for 5.4.3 - 5.4.20
Default timezone: 1394711463<br /> America/New_York: 1394711463<br /> Europe/Amsterdam: 1394711463<br /> WORK AROUND<br /> Default timezone: 1394715063<br /> America/New_York: 1394697063<br /> Europe/Amsterdam: 1394715063<br />
Output for 5.3.12 - 5.3.28, 5.4.0 - 5.4.2
Default timezone: 1394711464<br /> America/New_York: 1394711464<br /> Europe/Amsterdam: 1394711464<br /> WORK AROUND<br /> Default timezone: 1394715064<br /> America/New_York: 1394697064<br /> Europe/Amsterdam: 1394715064<br />
Output for 5.3.29
Default timezone: 1409329096<br /> America/New_York: 1409329096<br /> Europe/Amsterdam: 1409329096<br /> WORK AROUND<br /> Default timezone: 1409336296<br /> America/New_York: 1409314696<br /> Europe/Amsterdam: 1409336296<br />
Output for 5.3.11
Default timezone: 1394711464<br /> America/New_York: 1394711465<br /> Europe/Amsterdam: 1394711465<br /> WORK AROUND<br /> Default timezone: 1394715065<br /> America/New_York: 1394697065<br /> Europe/Amsterdam: 1394715065<br />
Output for 5.3.0 - 5.3.10
Default timezone: 1394711465<br /> America/New_York: 1394711465<br /> Europe/Amsterdam: 1394711465<br /> WORK AROUND<br /> Default timezone: 1394715065<br /> America/New_York: 1394697065<br /> Europe/Amsterdam: 1394715065<br />
Output for 5.2.0 - 5.2.17
Fatal error: Call to undefined method DateTime::getTimestamp() in /in/I1hiH on line 3
Process exited with code 255.
Output for 5.0.0 - 5.1.6
Fatal error: Class 'DateTime' not found in /in/I1hiH on line 2
Process exited with code 255.
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: datetime in /in/I1hiH on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: datetime in /in/I1hiH on line 2