TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-24-2009, 09:27 AM   #1 (permalink)
The Acquainted
 
captainmerton's Avatar
 
Join Date: May 2009
Posts: 178
Thanks: 9
captainmerton is on a distinguished road
Default Handling different timezone

On the shared hosting package I have the timezone is set to Central European Time for the php installation on the web server and the mysql database. I dont have root access to change this however i can alter settings using a php.ini file etc. I want to set both to London time. I was thinking of using this sql statement on every connection to the database:

SET time_zone = '-1:00';

I was also going to set the php time using this statement or alternatively just change it in the php.ini file:

ini_set('date.timezone', 'Europe/London');

The query I have is I've read somewhere that I will encounter problems when daylight saving changes etc come into play and the difference between CET and GMT isnt 1hr. I read somewhere that even setting the db timezone like this wont resolve this:

SET time_zone = 'Europe/London';

Anybody got any suggestions or guidance? Thanks.
captainmerton is offline  
Reply With Quote
Old 12-10-2009, 02:50 AM   #2 (permalink)
The Wanderer
 
Join Date: Dec 2008
Posts: 16
Thanks: 2
ChrisR is on a distinguished road
Default

This is how my friend done it.

make a function and make sure your server timezone is GMT

PHP Code:
function getTime($timzone){
return 
time() + 60 $timezone;
}

getTime(2); // Get's the current time of GMT+2 
ChrisR is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Timezone Class: Dealing with Timezones the Proper Way Wildhoney General 2 01-10-2011 11:01 PM
ilias session handling problem nanhe TalkPHP Developer Team 0 06-01-2009 01:40 PM
Error handling Ross TalkPHP Developer Team 0 01-17-2009 10:27 PM
Error Handling and Exceptions Farmer Absolute Beginners 3 12-11-2008 06:41 PM
Users Timezone CMellor General 2 09-26-2007 10:12 PM


All times are GMT. The time now is 05:09 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design