473,508 Members | 2,398 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

set timezone with php4

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
2 18795
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1341
by: Jason Kinkade | last post by:
I recently installed MySQL 4.0.18 on my slackware 9.1 machine (kernel 2.4.25) by compiling the source. It works fine, and all tests pass except one. The timezone test. Can someone tell me why...
7
3190
by: Jim Davis | last post by:
I'm (still) working on an ISO 8601 date parser. I want to convert at least the formats described here: http://www.w3.org/TR/NOTE-datetime Well.. I've got most of it working (via RegEx's) good...
1
4009
by: cnliou | last post by:
Hi! If I correctly understand v7.4 manual, value, say, '2003-11-26 12:00' in TIMESTAMP WITHOUT TIMEZONE column should output '2003-11-26 19:00' for "+08:00" timezone. The following test...
1
2544
by: Raj Chudasama | last post by:
I have the following code for a clock in my gui. Everything works fine EXCEPT the following line when the TimeZone is changed in the windows. string tz = TimeZone.CurrentTimeZone.StandardName;...
2
4738
by: David Garamond | last post by:
When a timestamp string input contains a timezone abbreviation (CDT, PST, etc), which timezone offset is used? The input date's or today date's? The result on my computer suggests the latter. #...
13
2827
by: Bruno Wolff III | last post by:
Recently there has been some discussion about attaching a timezone to a timestamp and some other discussion about including a 'day' part in the interval type. These two features impact each other,...
3
8307
by: asanford | last post by:
I want to create a web service that allows the caller to pass a DateTime to the web service (that is, create a web method such as void MyWebMethod(DateTime dt).) However, I want to be able to...
0
1330
by: Derek Fountain | last post by:
I'm using PHP4 and have got myself confused over timezones. I've put a datetime into my MySQL table as a GMT time. MySQL shows me the data as '2007-04-06 16:04:56'. I put that in there just after...
2
3672
by: =?Utf-8?B?Sm9ubnk=?= | last post by:
I have an ASP.NET 2.0 C# web application that is contacting an Exchange server using WEBDAV. It allows the users to look up appointments for a future date. The problem I have is determining the...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7133
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.