tags:

views:

24

answers:

1

Hi

I have php page in a server, located in US.

the code in the page is

echo date('Y-m-d H:i:s');

When i take this page, it give a time //eg 2010-10-26 10:20:07

But when i refresh the page on very next second, it gives same date with different time (a huge difference )

//eg 2010-10-26 08:25:58

Can any one tell the reason for that?

+2  A: 

If you are on shared hosting someone might be changing the server locale or server timezone. Actually, two people might be changing it which causes it to jump back and forth each page refresh as one scripts sets it to one thing while another sets it to another thing.

Xeoncross
@Xeon do you know of any general cure-alls for this sort of behavior, or does it depend heavily on the host Linto is using?
treeface
But in that domain only this php page is there.No other page in the domain
Linto P D
If you mean domain as in the website domain (example.com) then I don't think it matters. The change is server wide. However, I'm not sure about certain "domains" (other use of the word). Have you tried kijins suggestion of `print date_default_timezone_get()`?
Xeoncross