Hi, I am trying to display time in php for different time zones, such as +1, +6 or any other time zone, what code can I use to display current time for specific zones? Any help would be appreciated! Thanks
Take a look at php.net/manual/en/class.datetimezone.php as a starting point for what you want. (You'll need php 5.2+) <?php // Create two timezone objects, one for Taipei (Taiwan) and one for // Tokyo (Japan) $dateTimeZoneTaipei = new DateTimeZone("Asia/Taipei"); $dateTimeZoneJapan = new DateTimeZone("Asia/Tokyo"); // Create two DateTime objects that will contain the same Unix timestamp, but // have different timezones attached to them. $dateTimeTaipei = new DateTime("now", $dateTimeZoneTaipei); $dateTimeJapan = new DateTime("now", $dateTimeZoneJapan); PHP: