469,282 Members | 1,681 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

Time different between my apache server and my local clock

I actually have two questions:

1. I try to get current time, but the time I got is 1 hour different from my
local time. I assume it is caused by Time Zone. So is there any easy way to
fix this? I assume that I can first get the Time Zone of the server by using
the T option in date, and then using my local Time Zone to calculate the
difference. But I am wondering if there is some buil-in function to do it.

2. I found out this also today while workng on the same project. My apache
clock is 10 mins slower than my local clock. Any suggection to calibrate the
apache server clock (I don't own the server)?

Thanks in advance.

-Steven
Jul 16 '05 #1
1 4803
Make a function like
(substitute mdifference, hdifference for the difference in the clocks and
adjust +/- accordingly, though this is untested it shoudl work)
function localdate()
{
$hourdifference = "1";
$mdifference = "10";
$hour = date('h') + $hdifference;
$minute = date('i') + mdifference;
if($i < 10)
{
$minute = "0".$minute;
}
$both = $hour.$minute;
return $both;
}

"Steven" <xu*****@comcast.net> wrote in message
news:AKLOa.13919$H17.5375@sccrnsc02...
I actually have two questions:

1. I try to get current time, but the time I got is 1 hour different from my local time. I assume it is caused by Time Zone. So is there any easy way to fix this? I assume that I can first get the Time Zone of the server by using the T option in date, and then using my local Time Zone to calculate the
difference. But I am wondering if there is some buil-in function to do it.

2. I found out this also today while workng on the same project. My apache
clock is 10 mins slower than my local clock. Any suggection to calibrate the apache server clock (I don't own the server)?

Thanks in advance.

-Steven

Jul 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by dan glenn | last post: by
2 posts views Thread by arcvonz | last post: by
7 posts views Thread by WindAndWaves | last post: by
12 posts views Thread by aegis | last post: by
74 posts views Thread by Dominik Wallner | last post: by
37 posts views Thread by David T. Ashley | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.