PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > The PowWeb Platform > .htaccess / Scheduled Jobs
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
 
Thread Tools
Old 12-15-09, 10:39 AM   #1
cristian
Registered
 
Join Date: Dec 2009
Location: Barcelona
Posts: 3
Reputation: 0
Problem setting the Timezone of the server

Before you say it, I have checked in the forum for this issue, but I haven't seen any solution.

I am from Barcelona, Spain, and I want to set the timezone of the server in my local time.

I have done that the fixed post says in this forum about to put:

SetEnv TZ Europe/Madrid


in .htaccess but it doesn't work for me.

So, please, anyone can help me to put the server time in my local time?

Thank you!
cristian is offline  
Old 12-15-09, 10:43 AM   #2
IanS
Former Spam Filter (EU)
 
IanS's Avatar
 
Join Date: Mar 2004
Location: Washington (THE original UK one!)
Posts: 12,888
Reputation: 470
As you're on a shared system, it's unlikely that you can set the server time, or I'm misunderstanding you.

The way I'd suggest is to take the time from the server and add the offset required. Server time is Boston, USA time.
__________________
This is a Powweb customer
helping Powweb customer forum.

I am a customer just like you!!

Some matters can only be answered by staff or support.
Give it a go - ask here first!
IanS is offline  
Old 12-15-09, 10:53 AM   #3
cristian
Registered
 
Join Date: Dec 2009
Location: Barcelona
Posts: 3
Reputation: 0
Quote:
Originally Posted by IanS View Post
As you're on a shared system, it's unlikely that you can set the server time, or I'm misunderstanding you.

The way I'd suggest is to take the time from the server and add the offset required. Server time is Boston, USA time.
Thank you for your quick Answer IanS.

I know that I am on a shared system, so, when it's said to change the server time, I want to say change "the server time for my site". It's the same that you suggested me but, done automatically for my site. I know that this can be fixed.

The offset solution could be a solution but we don't have the same offset time during all the whole year, and this will make me to be changing it always.
cristian is offline  
Old 12-15-09, 11:23 AM   #4
IanS
Former Spam Filter (EU)
 
IanS's Avatar
 
Join Date: Mar 2004
Location: Washington (THE original UK one!)
Posts: 12,888
Reputation: 470
You could always attempt the programming of the change to be automatic.

Quote:
Originally Posted by NASA website
The following table gives the dates and times when Daylight Saving Time is in effect in the United States and Europe from 2001 through 2015:

Daylight Saving Time 2001 - 2015
Year United States European Union
Daylight Saving Time
Begins at 2 a.m. Daylight Saving Time
Ends at 2 a.m. Summer Time
Begins at 1 a.m. GMT Summer Time
Ends at 1 a.m. GMT
2001 April 01 October 28 March 25 October 28
2002 April 07 October 27 March 31 October 27
2003 April 06 October 26 March 30 October 26
2004 April 04 October 31 March 28 October 31
2005 April 03 October 30 March 27 October 30
2006 April 02 October 29 March 26 October 29
2007 March 11 November 04 March 25 October 28
2008 March 09 November 02 March 30 October 26
2009 March 08 November 01 March 29 October 25
2010 March 14 November 07 March 28 October 31
2011 March 13 November 06 March 27 October 30
2012 March 11 November 04 March 25 October 28
2013 March 10 November 03 March 31 October 27
2014 March 09 November 02 March 30 October 26
2015 March 08 November 01 March 29 October 25
And
Quote:
Originally Posted by WIKIPEDIA
Exact timing in the next several years
European Summer Time begins (clocks go forward) at 01:00 GMT on

29 March 2009
28 March 2010
27 March 2011
25 March 2012
Formula used to calculate the beginning of European Summer Time:

Sunday (31 − (5y 4 + 4) mod 7) March at 01:00 GMT

(valid until 2099[4]), where y is the year, and for the nonnegative a, a mod b is the remainder of division after truncating both operands to an integer.

European Summer Time ends (clocks go backward) at 01:00 GMT on

25 October 2009
31 October 2010
30 October 2011
28 October 2012
Formula used to calculate the end of European Summer Time:

Sunday (31 − (5y 4 + 1) mod 7) October at 01:00 GMT

(validity as above).
should be the info you need for the programming.
__________________
This is a Powweb customer
helping Powweb customer forum.

I am a customer just like you!!

Some matters can only be answered by staff or support.
Give it a go - ask here first!
IanS is offline  
Old 12-16-09, 07:19 AM   #5
cristian
Registered
 
Join Date: Dec 2009
Location: Barcelona
Posts: 3
Reputation: 0
Ok, I have the solution.

Before all, thanks to IanS for your help! Your solution should work but I think that do that in every script it's not the best way.

I open a support ticket, what I have found that when we use date.timezone = "Europe/Madrid" in the ini.php the php ignores it. It's a bug I think following the link: http://bugs.php.net/bug.php?id=45191

So what support has done is to add:

PHP Code:
Automatically add files before or after any PHP document.
auto_prepend_file = /home/users/web/bxxxx/pow.user/htdocs/timezone.php 
and in that script you can put:

PHP Code:
<?
date_default_timezone_set  
'Europe/Madrid'  )
?>
And then works.
cristian is offline  
Closed Thread

Thread Tools

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 Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:30 AM.


Contents ©PowWeb, Inc. ~ vBulletin, Copyright 2000-2007 Jelsoft Enterprises Limited.