422,347 Members | 1,913 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,347 IT Pros & Developers. It's quick & easy.

set timezone with php4

P: n/a
mun
My server is in the US and I want to set a different timezone (GMT
+7), so that I can have an appropriate time for my country. How to do
this in php4?

Mar 21 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Mar 21, 5:52 am, "mun" <vong...@gmail.comwrote:
My server is in the US and I want to set a different timezone (GMT
+7), so that I can have an appropriate time for my country. How to do
this in php4?
Use gmdate() at time of storing date in DB. and add your required
time(+7 hr) at the time of using that or

putenv("TZ=Asia/Calcutta");
echo "New Time: ". date("h:i:s")."\n";

Complete time zone listing is here:
http://www.theprojects.org/dev/zone.txt

Happy Programming.

Mar 26 '07 #2

P: n/a
mun
On Mar 26, 1:09 pm, "Satya" <satya61...@gmail.comwrote:
On Mar 21, 5:52 am, "mun" <vong...@gmail.comwrote:
My server is in the US and I want to set a different timezone (GMT
+7), so that I can have an appropriate time for my country. How to do
this in php4?

Use gmdate() at time of storing date in DB. and add your required
time(+7 hr) at the time of using that or

putenv("TZ=Asia/Calcutta");
echo "New Time: ". date("h:i:s")."\n";

Complete time zone listing is here:http://www.theprojects.org/dev/zone.txt

Happy Programming.
thank you. but I dont understand the phrase "add your required
time(+7 hr) at the time of using that".
Mar 30 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.