python72 Posted November 27, 2010 Share Posted November 27, 2010 I am trying to get local date/time. In my php file I am setting my timezone using $timezone = "America/Toronto"; putenv ('TZ=' . $timezone); Then I use the following to get current date and time print_r (getdate()); but my date displays in GMT, What am I doing wrong? As in the code above I am in Toronto and I need EST. Quote Link to comment Share on other sites More sharing options...
trq Posted November 27, 2010 Share Posted November 27, 2010 Is there a particular reason your using php4 ? Quote Link to comment Share on other sites More sharing options...
python72 Posted November 27, 2010 Author Share Posted November 27, 2010 That is what my hosting provider has, I have tried to use the date_default_timezone_set('America/Toronto'); but I get errors. Quote Link to comment Share on other sites More sharing options...
trq Posted November 27, 2010 Share Posted November 27, 2010 date_default_timezone_set requires php5. Quote Link to comment Share on other sites More sharing options...
python72 Posted November 27, 2010 Author Share Posted November 27, 2010 That is why I am trying to use the putenv But don't know what I am doing wrong Quote Link to comment 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.