get server time in php - timezone issues

zenney

New Member
on shell, my server time is (simple \[code\]date\[/code\] in bash):Sun Aug 29 10:37:12 EDT 2010when I run the code \[code\]php -r "echo date('Y-m-d H:i:s');"\[/code\] I get: 2010-08-29 10:37:10but when I execute a php script that has \[code\]echo date('Y-m-d H:i:s');\[/code\] I get a different time- since php thinks the timezone is UTC (server time is EDT).My php.ini file has no timezone set, and I wouldnt like to change anything- as I have no idea what affect it would have on other sites that run on this server.Is there a simple way to get the server time- at the timezone that is set for the server?
 
Back
Top