Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // now
- $date = date_create('2010-12-31 22:00:01', timezone_open('Europe/Amsterdam'));
- // Buenos Aires
- date_timezone_set($date, timezone_open('America/Argentina/Buenos_Aires'));
- echo $date->format('Y-m-d H:i:s');
- // 2010-12-31 18:00:01
- // UTC
- date_timezone_set($date, timezone_open('UTC'));
- echo $date->format('Y-m-d H:i:s');
- // 2010-12-31 20:00:01
- // London
- date_timezone_set($date, timezone_open('Europe/London'));
- echo $date->format('Y-m-d H:i:s');
- // 2010-12-31 21:00:01
- // Maldives
- date_timezone_set($date, timezone_open('Indian/Maldives'));
- echo $date->format('Y-m-d H:i:s');
- // 2011-01-01 02:00:01
- // Melbourne
- date_timezone_set($date, timezone_open('Australia/Melbourne'));
- echo $date->format('Y-m-d H:i:s');
- // 2011-01-01 08:00:01
Add Comment
Please, Sign In to add comment