Go Back   Free website templates > Web Template Help > PHP and MySQL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read


Join now to download all the free website templates or post on the forum. If you have never been on a forum before read the FAQ. It's quick, easy and free to join!
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-14-2009, 10:24 AM
Junior Member
 
Join Date: Jun 2009
Posts: 25
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 .

<?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
Reply With Quote
  #2 (permalink)  
Old 07-14-2009, 12:00 PM
Junior Member
 
Join Date: Feb 2009
Posts: 4
soka is on a distinguished road
Default

can we not change the timezone in cpanel ?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 11:58 AM.



mouseover mouseover mouseover