On Friday 28 December 2007 23:48:21 tedd wrote:
> At 7:45 PM +0100 12/28/07, Børge Holen wrote:
> >On Friday 28 December 2007 16:46:46 tedd wrote:
> >  > So, what's the best method in keeping things consistent across
> >>
> >>  servers? Is there one?
> >
> >I almost took to a baseballbat, till I remembered to change php.ini to co
> > run two servers. Of course doing this in severeal servers all across the
> > world probably would result in some timeerror somewhere, but it did the
> > job for me EASY!!
>
> Well, I'm glad it was easy for you, but this has
> been, and remains, confusing and frustrating for
> me.

Shouldn't be... two different servers where the timezone in php.ini is set 
different.
It does not do anything useful, EXCEPT giving you the possability to offset/ 
skew the time in php. 

Short version and a hand on explanation:
Say I maintain a machine in seattle and my own here in norway. 9 hours time 
difference. 
These two is handling a site together and the database timestamp has to be the 
same, on a date not yet arrived on the other.
I can now offset one of the machines 9 hour forth or back to fit my need.

of course this only work if you handle one domain (or more in one country). If 
not... you must use the solution presented by the others here.


>
> Here's the problem if anyone cares to stress themselves.
>
> Here is the code and demo:
>
> http://webbytedd.com/c/unix-time1/index.php
>
> It works for me on my server.
>
> However, when I use the exact same function for a
> client on his server and enter:
>
> 10-18-2009 00:00:00
>
> The function changes the date to:
>
> 10-18-2009 12:00:00
>
> What's going on here?

That was my problem to, till I found the bugger in the ini file:
[Date]
; Defines the default timezone used by the date functions
date.timezone = 0

that is the line you are looking for... or would if you had access to it.
with the lines the other nice ppl provided, you do exactly the same, just not 
system wide.

>
> Cheers,
>
> tedd
>
> PS: I have no control over the php.in file.

shoot the administrator..
or add a code to offset the time

>
> --
> -------
> http://sperling.com  http://ancientstones.com  http://earthstones.com



-- 
---
Børge Holen
http://www.arivene.net

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to