ODSOL Premium Web Hosting :: Web Hosting - Ecommerce Hosting - Reseller Hosting - Virtual Dedicated Server - Managed Dedicated Server - Domain Registration.
Web Hosting cheap web hosting services web site hosting
ODSOL Premium Web Hosting Services web page hosting
ODSOL Premium Web Hosting Services ODSOL Premium Web Hosting Services ODSOL Premium Web Hosting Services
ODSOL Premium Web Hosting Services business web hosting
web hosting company Home web hosting reseller web hosting low cost web hosting
ecommerce web hosting
web hosting
affordable web hosting

Go Back   ODSOL Help Desk » FAQ » PHP »
Email
Password


How do I change timezone for PHP? Rating:
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 so:
PHP Code:
 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
include()'ed by all your other PHP scripts, then all your PHP scripts will use that timezone.

A list of timezones to choose from, other than "US/Eastern" for your putenv() is here:

http://www.theprojects.org/dev/zone.txt


User Comments


Categories
Getting Started (6) Billing (4) Web Hosting (0)
Domain Name (6) FTP (1) Email (4)
Frontpage (2) Control Panel (0) CGI (3)
PHP (3) MySQL (5) Ecommerce (1)
Pre-Sales (0) Reseller (0)  
Search

All times are GMT. The time now is 05:19 PM.

web hosting
lowcost web hosting
web hosting
Site map - Terms of Service - Contact Us
Home | Domain Name | Web Hosting | Ecommerce Hosting | Reseller Hosting | VDS | Dedicated Server | FAQ | Support | Directory
christian web hosting web hosting web site hosting
web page hosting free web hosting