Ad block is installed and active. Please support us by disabling it.
HomeMonday, January 22, 2018, 18:20:14
1

PHP DateTimeZone

Tuesday, February 10, 15, 13:53:03, 3 Yaers Ago Via wain, Hits: 3491
PHP representation of time zone
Example:
Code:
<?php
$date_at_timezone = new DateTimeZone('Europe/London');
$date_at_timezone2 = new DateTimeZone('Europe/Belgrade');
$date_at_timezone3 = new DateTimeZone('Australia/Queensland');
$date_at_timezone4 = new DateTimeZone('Australia/Sydney');
$date = new DateTime();
$date->setTimezone($date_at_timezone);
echo $date->format('l dS F Y h:i:s A') . " London<br>";
$date->setTimezone($date_at_timezone2);
echo $date->format('l dS F Y h:i:s A') . " Belgrade<br>";
$date->setTimezone($date_at_timezone3);
echo $date->format('l dS F Y h:i:s A') . " Queensland<br>";
$date->setTimezone($date_at_timezone4);
echo $date->format('l dS F Y h:i:s A') . " Sydney<br>";
?>


Output:
Wednesday 29th September 2010 01:22:24 PM London
Wednesday 29th September 2010 02:22:24 PM Belgrade
Wednesday 29th September 2010 10:22:24 PM Queensland
Wednesday 29th September 2010 10:22:24 PM Sydney

Sign In

Sponsor

Related

MySQL Inner Join

MySQL Inner Join - Creating Dynamic Webpages Using PHP and MySQL, Requirement(s): PHP Server, MySQL

GuestBook PHP Script

Allow visitors to leave messages on your site. It features easy install, admin notification, and control panel to remove unwanted entries.

PHP Mail

Sends an email.

Getimagesize

Getimagesize function will determine the size of any given image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag and the correspondant HTTP content type.

Filter Words in PHP - PHP Tutorial

Filter bad words in PHP, requirement(s): PHP server

Upload Attachment - PHP Tutorial

Upload attachment with PHP example, Requirement(s): PHP server

PHP Date Examples

Returns a string formatted according to the given format string using the given integer timestamp or the current time if no timestamp is given.

Preventing multiple form submissions

Preventing multiple form submissions

MySQL – Select from two tables

Select data from two tables, PHP MySQL

Password Protect With PHP

Password protect tith PHP - tutorial
About Author

wain

Date Registered: Sun, Feb 8, 15
Last Time Online: Thu, Jun 15, 17
So far has created 115 entries.
wain
This author has not yet filled in any details.