FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Time





coreymanshack
Is there a way I can edit the "server" time for my websites, or do i need to add my offset to all php times?
AftershockVibe
There are a few ways to do this. Both involve using some sort of common header file for your pages.

Code:
putenv("TZ=US/Eastern");

That will mean that date() will automatically adjust times to your timezone settings.

Alternatively you can just define a function, say getLocalDateTime() to offset the normal time by so many hours then return it and call that instead.

If you don't have a common header file already in place (it's usually sensible practice) then you can use .htaccess to automatically prepend one. That's a topic for a different thread though.
coreymanshack
AftershockVibe wrote:
There are a few ways to do this. Both involve using some sort of common header file for your pages.

Code:
putenv("TZ=US/Eastern");

That will mean that date() will automatically adjust times to your timezone settings.

Alternatively you can just define a function, say getLocalDateTime() to offset the normal time by so many hours then return it and call that instead.

If you don't have a common header file already in place (it's usually sensible practice) then you can use .htaccess to automatically prepend one. That's a topic for a different thread though.


Thanks
Related topics
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.