Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

change timezones in php

Thu Nov 27, 2008 4:42 pm

PHP scripting language have an built in function to change between the timezones , you will need the PEAR package . In the following example show you how to convert from GMT system format to IST Format .
Code:
<?php
// include class
include ("Date.php");

// initialize object
$d = new Date("2008-10-03 16:23:48");

// set server time zone
$d->setTZByID("GMT");

// print server time
echo "Local time is " . $d->format("%A, %d %B %Y %T") . "\n";

// convert to IST
$d->convertTZByID("PST");

// output converted date/time
echo "Destination time is " . $d->format("%A, %d %B %Y %T");
?>




Post a reply
  Related Posts  to : change timezones in php
 change the MAC address     -  
 change the style of the kbd     -  
 How to change this title • ?     -  
 How to change the JAR Icon     -  
 Change the properties of div tag     -  
 Change cursor to help     -  
 Skymiles Colour Change?     -  
 change button location in in C#     -  
 Change the shading of object     -  
 Change cursor to move     -  

Topic Tags

PHP Date