HomeMonday, July 24, 2017, 22:35:53
1

PHP DateTimeZone

Tuesday, February 10, 15, 13:53:03, 3 Yaers Ago Via wain, Hits: 2448
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

PHP/MySQL Bookmarklet - PHP Tutorial

PHP/MySQL bookmarklet, bookmark current page, PHP/MySQL tutorial.

PHP imagecreate

imagecreate() returns an image identifier representing a blank image of specified size.

PHP filesize

The filesize function returns the size of the specified file.

Tell A Friend with Captcha

This form allows your visitors to suggest your site to a friend. It features an HTML email format and an admin notification email.

Email Link

HTML email link example

PHPBB3 Shoutbox

Vesion: 1.1. Released: 08/08/10, Licence GNU, Price: Free

PHP Form Action Self Submit

PHP form action self submit tutorial, requirement(s): PHP server

HTML Button Generator

This script will allow your visitors to create HTML Buttons online. To use the "html button generator" script completely free , the "powered by" link at the bottom of the pages must stay intact.

Timed Redirect JavaScript

Timed redirect javaScript/PHP example

Images In Textarea - CSS

Tutorial Images in Textarea
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.