Objectmix
Tags Register Mark Forums Read

change timezones in php : PHP

This is a discussion on change timezones in php within the PHP forums in Programming Languages category; Hi, 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"); ?>...


Object Mix > Programming Languages > PHP > change timezones in php

Reply

 

LinkBack Thread Tools
  #1  
Old 07-13-2009, 11:38 PM
Junior Member
 
Join Date: Jun 2009
Posts: 0
gilbertsavier is on a distinguished road
Default change timezones in php

Hi,
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");

?>
__________________
Thanks & regards,
Lokananth
Live Chat Software By miOOt
Reply

Thread Tools


Similar Threads

Thread Thread Starter Forum Replies Last Post
Using timezones usenet PHP 2 05-04-2007 09:16 AM
available timezones usenet PHP 0 07-26-2004 12:34 AM
timezones usenet PHP 6 05-01-2001 09:11 AM
Re: [PHP] timezones usenet PHP 0 04-30-2001 02:12 PM
Timezones usenet Weblogic 5 07-26-2000 08:35 AM


All times are GMT -5. The time now is 12:49 AM.

Managed by Infnx Pvt Ltd.