bob_the _builder Posted May 13, 2007 Share Posted May 13, 2007 Hi, The server I host on is different time zone to me, is there away I can set the GMT on my site so Dates and Times are correct to my time zone? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/51151-gmt/ Share on other sites More sharing options...
trq Posted May 13, 2007 Share Posted May 13, 2007 Take a look at the init_set function. Quote Link to comment https://forums.phpfreaks.com/topic/51151-gmt/#findComment-251824 Share on other sites More sharing options...
bob_the _builder Posted May 13, 2007 Author Share Posted May 13, 2007 Hi, I havnt found much about that function to alter date/time. I have come across: putenv("TZ=Pacific/Auckland"); Which seems to work if added to scripts. Quote Link to comment https://forums.phpfreaks.com/topic/51151-gmt/#findComment-251827 Share on other sites More sharing options...
bob_the _builder Posted May 13, 2007 Author Share Posted May 13, 2007 Can it be changed in a php.ini file located in public_html dir? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/51151-gmt/#findComment-251837 Share on other sites More sharing options...
PC Nerd Posted May 13, 2007 Share Posted May 13, 2007 um well if its a shared host ,ie, like no root access to php.ini, then you can use the .htaccess file to customise things like your php version if they offer different versions etc. in the time or date functions, is there actually a part where you can get the timezone....... in which you could simply conver the timzone? gdlk Quote Link to comment https://forums.phpfreaks.com/topic/51151-gmt/#findComment-251865 Share on other sites More sharing options...
chigley Posted May 13, 2007 Share Posted May 13, 2007 <?php ini_set("date.timezone", "Europe/London"); // Rest of code here ?> A list of timezones can be found at http://uk2.php.net/manual/en/timezones.php Quote Link to comment https://forums.phpfreaks.com/topic/51151-gmt/#findComment-251870 Share on other sites More sharing options...
bob_the _builder Posted May 13, 2007 Author Share Posted May 13, 2007 Can it be done via php.ini rather than within the php script? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/51151-gmt/#findComment-251890 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.