Posts Under 'timezone'

How do I change timezone for PHP?

If you only want particular PHP scripts and not shell or other cgi scripts to use a specific timezone, set the timezone environmental variable in your PHP code like below: <?php echo "Original Time: ". date("h:i:s")."\n"; putenv("TZ=US/Eastern"); echo "New Time: ". date("h:i:s")."\n"; ?> If you put the line putenv("TZ=US/Eastern"); in a file that is included […]

Read more »