tux_linux 0 Report post Posted November 1, 2004 HI!I have a question about time in php. I get the time with this syntax:<?$time=getdate();print_r($time);?>So my problem is that the time isn´t right???????I am from austria and so i must select the timezone, but how can i do this???Is the servertime right????thx tux Share this post Link to post Share on other sites
vptr 0 Report post Posted November 1, 2004 Hello,Read here about how to select timezone: http://support.modwest.com/content/5/258/en/how-do-i-change-timezone-for-php.html Share this post Link to post Share on other sites
avalon1405241471 0 Report post Posted November 3, 2004 Try this: <?php//If your server time is GMT.$austria_time  = date("M j Y, D G+1:i:s");echo $austria_time;//Result: Nov 3 2004, Wed 21:45:08$austria_time1  = date("M j Y, D h+1:i a");echo $austria_time1;//Result: Nov 3 2004, Wed 9:45 pm?> It should work, if it does not, let me know. Share this post Link to post Share on other sites
pedro1405241472 0 Report post Posted November 3, 2004 <?echo "Original Time: ". date("h:i:s")."\n";putenv("TZ=US/Eastern");echo "New Time: ". date("h:i:s")."\n";?> Share this post Link to post Share on other sites